dispatch latency
Picture a relay race where one runner must stop, hand off the baton, and the next runner must accept it and start sprinting. The fumbling moment of the handoff — when neither runner is making forward progress — is wasted time. Dispatch latency is that handoff cost for the CPU: the time it takes from the moment one process stops to the moment the next process actually starts running useful instructions.
Where does the delay come from? Two main parts. First, the OS must stop whatever was running and resolve any conflicts — for instance, finishing or deferring kernel work, and in a preemptive kernel, releasing locks so a higher-priority process can proceed. Second, the dispatcher must do the context switch: save the old process's state and load the new one's. All of this is overhead — the CPU spends it on bookkeeping, not on the program's actual work.
Why it matters: dispatch latency sets a floor on how quickly a system can react. For an interactive desktop a few microseconds is invisible. For a real-time system controlling a motor or an airbag, the worst-case dispatch latency must be small and predictable, because a late response can be a failure. It also explains why an extremely small time quantum is wasteful — if you switch every fraction of a millisecond, a large share of every slice is eaten by latency instead of computation.
A high-priority alarm-handling thread becomes ready while a low-priority logger is running. Dispatch latency is the gap between that instant and the alarm thread executing its first instruction: the kernel must preempt the logger, possibly release a lock it holds, and do the context switch. If a quantum is 100 microseconds and dispatch latency is 10 microseconds, fully 10 percent of the CPU is overhead.
Smaller quanta amplify dispatch latency as a fraction of useful work; real-time systems care about its worst case.
Dispatch latency is overhead you minimize but can never reach zero — every switch costs something, which is the real reason round-robin's quantum cannot be made arbitrarily tiny.