Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Operating System  >  Difference Between Dispatcher & Scheduler

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE) PDF Download

Schedulers

Schedulers are special system software which handle process scheduling in various ways. Their main task is to select the jobs to be submitted into the system and to decide which process to run.
There are three types of Scheduler:

  1. Long term (job) scheduler: Due to the smaller size of main memory initially all program are stored in secondary memory. When they are stored or loaded in the main memory they are called process. This is the decision of long term scheduler that how many processes will stay in the ready queue. Hence, in simple words, long term scheduler decides the degree of multi-programming of system.
  2. Medium term scheduler: Most often, a running process needs I/O operation which doesn’t requires CPU. Hence during the execution of a process when a I/O operation is required then the operating system sends that process from running queue to blocked queue. When a process completes its I/O operation then it should again be shifted to ready queue. ALL these decisions are taken by the medium-term scheduler. Medium-term scheduling is a part of swapping.
  3. Short term (CPU) scheduler: When there are lots of processes in main memory initially all are present in the ready queue. Among all of the process, a single process is to be selected for execution. This decision is handled by short term scheduler.

Let’s have a look at the figure given below. It may make a more clear view for you.

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)

Dispatcher

A dispatcher is a special program which comes into play after the scheduler. When the scheduler completes its job of selecting a process, it is the dispatcher which takes that process to the desired state/queue. The dispatcher is the module that gives a process control over the CPU after it has been selected by the short-term scheduler. This function involves the following:

  1. Switching context
  2. Switching to user mode
  3. Jumping to the proper location in the user program to restart that program

The Difference between the Scheduler and Dispatcher

Consider a situation, where various processes are residing in the ready queue waiting to be executed. The CPU cannot execute all of these processes simultaneously, so the operating system has to choose a particular process on the basis of the scheduling algorithm used. So, this procedure of selecting a process among various processes is done by the scheduler. Once the scheduler has selected a process from the queue, the dispatcher comes into the picture, and it is the dispatcher who takes that process from the ready queue and moves it into the running state. Therefore, the scheduler gives the dispatcher an ordered list of processes which the dispatcher moves to the CPU over time.

Example:
There are 4 processes in the ready queue, P1, P2, P3, P4; Their arrival times are t0, t1, t2, t3 respectively. A First in First out (FIFO) scheduling algorithm is used. Because P1 arrived first, the scheduler will decide it is the first process that should be executed, and the dispatcher will remove P1 from the ready queue and give it to the CPU. The scheduler will then determine P2 to be the next process that should be executed, so when the dispatcher returns to the queue for a new process, it will take P2 and give it to the CPU. This continues in the same way for P3, and then P4.

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)
Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)

The document Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Operating System.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
10 videos|99 docs|33 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Difference Between Dispatcher & Scheduler - Operating System - Computer Science Engineering (CSE)

1. What is the difference between a dispatcher and a scheduler?
Ans. A dispatcher is responsible for assigning tasks to individuals or resources, ensuring that they are carried out efficiently and in a timely manner. On the other hand, a scheduler is responsible for creating and managing a schedule, organizing tasks and activities within a given timeframe.
2. What are the key responsibilities of a dispatcher?
Ans. The key responsibilities of a dispatcher include receiving and processing service requests, coordinating and dispatching resources to the appropriate location, maintaining communication with field personnel, and ensuring that tasks are completed according to priority and urgency.
3. What are the main duties of a scheduler?
Ans. The main duties of a scheduler include analyzing workloads and available resources, creating and managing schedules, assigning tasks and activities to specific time slots, monitoring progress and making adjustments as necessary, and ensuring that deadlines are met.
4. Can a dispatcher also perform scheduling tasks?
Ans. Yes, in some cases a dispatcher may also perform scheduling tasks. Depending on the organization and its specific needs, a dispatcher may be responsible for both assigning tasks and creating schedules. This allows for a more streamlined and efficient coordination of resources.
5. How do dispatchers and schedulers collaborate to optimize operations?
Ans. Dispatchers and schedulers collaborate closely to optimize operations by sharing information and coordinating efforts. Dispatchers provide real-time updates on task completion and resource availability, while schedulers analyze this information to make informed decisions about future assignments. This collaboration ensures that resources are utilized effectively, tasks are completed efficiently, and overall operational efficiency is enhanced.
10 videos|99 docs|33 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

study material

,

Objective type Questions

,

Sample Paper

,

MCQs

,

Exam

,

Extra Questions

,

practice quizzes

,

Viva Questions

,

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)

,

Summary

,

pdf

,

past year papers

,

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)

,

Semester Notes

,

Previous Year Questions with Solutions

,

ppt

,

Free

,

mock tests for examination

,

video lectures

,

Important questions

,

Difference Between Dispatcher & Scheduler | Operating System - Computer Science Engineering (CSE)

,

shortcuts and tricks

;