What is dispatcher and difference between dispatcher and scheduler?

Operating SystemHardwareSoftware & Coding

The dispatcher is done after the scheduler. It gives control of the CPU to the process selected by the short term scheduler. After selecting the process, the dispatcher gives CPU to it.

Functions of dispatcher

The functions of the dispatcher are as follows −

  • Switching context.

  • Switching to user mode.

  • Jumping to the proper location in the user program to restart that program.

  • The time it takes for the dispatcher to step one process and start another running is known as dispatch latency.

Given below is the diagram of dispatcher −


The differences between scheduler and dispatcher are as follows −

  • All the processes are in a ready state with no schedule.

  • At that time the scheduler used some algorithm.

  • Scheduling is done for all the processes in the ready queue.

  • After completing scheduling, the dispatcher enters.

  • The dispatcher moves the selected process from the ready queue into the running state.

  • The same process continues simultaneously.

  • Scheduler scheduling the process, at the same time dispatcher dispatches selected processes to the running state.

Role of the dispatcher in CPU scheduling

The dispatcher gives control of the CPU to the process selected by the short-term scheduler.

In order to perform this task, a context switch, a switch to user mode, and a jump to the proper location in the user program are all required.

The dispatch should be made as fast as possible. The time lost to the dispatcher is termed dispatch latency.

Updated on 01-Dec-2021 11:59:38