It's not just about the OS, it's about the platform (hardware). Even with a fully-optimized RTOS on a standard PC platform, you might run into millisecond-latency due to non-maskable interrupts, cache misses or bus contention (DMA bus-mastering kills any real-time guarantees). That's not even considering the stalls introduced by SMM or TPM instructions.