operating-systems

Definition

Dispatcher

The dispatcher is the component of the operating system kernel that gives control of the CPU to the process selected by the short-term scheduler. It is responsible for the actual mechanism of switching the CPU from one process to another.

Functions

The dispatcher performs the following critical tasks during a context switch:

  1. Saving Context: Storing the state of the previously running process in its PCB.
  2. Loading Context: Restoring the state of the new process from its PCB.
  3. Switching Modes: Transitioning the processor from kernel mode to user mode.
  4. Jumping: Moving the program counter to the proper location in the user program to resume execution.

Dispatch Latency

The time it takes for the dispatcher to stop one process and start another is known as dispatch latency. This latency is a pure overhead and should be minimised to ensure high system responsiveness.