Linux – Why does Windows not need a low latency or real time kernel

audio recordinggamingkernellatencylinux

All Linux distros have problems with latency when audio recording, gaming, etc. But the Windows kernel can be used for audio recording, gaming or anything without a delay.

Why does Windows not need a low latency or real time kernel or is it already one?

Best Answer

Neither Windows nor Linux is anything close to a real-time operating system (RTOS) and as far as I know, neither can be made to be so. The goals, requirements, and philosophies of RTOS versus general-computing differ too fundamentally for any one product to usefully answer both.

You simply can't risk having the vagaries of interrupt timing affect the behavior of anti-lock brakes or send a $2B Mars rover careening off a cliff... but prioritizing the relevant design necessities involves significant overhead that would, in general, be wasted on desktop computing scenarios.

As others have noted on this page, if some general-computing operating system happens to perform well on real-time tasks (such as those you mention), its likely just due to a lot of dreary empirical testing, profiling, and tuning work by the OS vendor. I say 'dreary', because those underlying real-time factors make progress in the tuning effort inherently non-deterministic.

As you can imagine, that's a wholly different universe from one where the entire software stack can fundamentally rely on maximum latency guarantees established by an RTOS. These maximums, which aggregate as deterministic "low-latency" overall, are incorporated into the very definition of RTOS correctness, meaning that a late result becomes "impossible" with properly working hardware. Timing errors either provably can't happen or become moot (perhaps because preconditions can't arise, etc.) and any such error is considered a total failure equally as wrong or inconceivable as obtaining 2 + 2 = 5.

Related: What does "Windows is not a real-time operating system" mean?.

Related Question