Key Difference – Scheduler vs Dispatcher
Scheduler and Dispatcher are associated with process scheduling of an operating system. The key difference between scheduler and dispatcher is that the scheduler selects a process out of several processes to be executed while the dispatcher allocates the CPU for the selected process by the scheduler.
In a computer system, several processes are running. Scheduling is the process of the operating system to decide which process should be allocated to the CPU for the execution of several processes.
1. Overview and Key Difference
2. What is Scheduler
3. What is Dispatcher
4. Relationship Between Scheduler and Dispatcher
5. Side by Side Comparison – Scheduler vs Dispatcher in Tabular Form
What is Scheduler?
There are three types of schedulers in an operating system. They are the long term scheduler, short term scheduler and medium term scheduler. The long term scheduler is also known as the job scheduler. In the computer system, there is a number of processes waiting for execution. These processes are placed in the secondary storage or the job queue to execute later. The objective of the long term scheduler is to select a processes from the job queue and to bring that process to the ready queue in the main memory.
The short term scheduler is also known as the CPU scheduler. The task of the short term scheduler is to select a process in the ready queue that should be allocated to CPU. The short term scheduler should pick a process from the ready queue while the previous process goes to waiting state. It should be fast otherwise the CPU time will be wasted.
The executing process might require an I/O operation. So, the process goes to the waiting state. This process is said to be suspended. For maximum CPU utilization, some other process should run. The suspended process is transferred back to the secondary memory. After some time, the transferred process can return back to the main memory and continue the execution from where it was terminated. Transferring the suspended process to the secondary memory is called swapping out. Bringing the process back to the main memory is known as swapping in. This swapping in and out is done by the medium scheduler.
What is Dispatcher?
When the short term scheduler selects from the ready queue, the dispatcher performs the task of allocating the selected process to the CPU. A running process goes to the waiting state for IO operation etc. Then the CPU is allocated to some other process. This switching of CPU from one process to the other is called as the context switching. A dispatcher performs various tasks including context switching, setting up user registers and memory mapping. These are necessary for the process to execute and transfer CPU control to that process. When dispatching , the process changes from ready state to running state.
Sometimes, the dispatcher is considered as a part of the short-term scheduler, so the whole unit is called as the short terms scheduler. In this scenario, the task of the short term scheduler is to select a process from ready queue and also to allocate the CPU for that process.
What is the Relationship Between Scheduler and Dispatcher?
- The dispatcher assigns the selected process by the short-term scheduler to the CPU.
What is the Difference Between Scheduler and Dispatcher?
Scheduler vs Dispatcher
|A scheduler is special system software that handles process scheduling by selecting the process to execute.||The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler.|
|There are three types of schedulers known as;
||There is no categorization for a dispatcher.|
|The long-term scheduler selects the process from the job queue and brings it to the ready queue.
The short term scheduler selects a process in the ready queue.
The medium scheduler carries out the swap in, swap out of the process.
|The dispatcher allocates the CPU to the process selected by the short-term scheduler.|
Summary – Scheduler vs Dispatcher
Scheduler and Dispatcher are used in process scheduling of an operating system. The difference between scheduler and dispatcher is that the scheduler selects a process out of several processes to be executed while the dispatcher allocates the CPU for the selected process by the scheduler.
1.Kiran Kumar. “Cpu Scheduling OS.” LinkedIn SlideShare, 16 July 2014. Available here
2.“What Is CPU Scheduling?” CPU Scheduling in Operating System | Studytonight. Available here
3.“Scheduling (Computing).” Wikipedia, Wikimedia Foundation, 31 Mar. 2018. Available here