SlideShare a Scribd company logo
13
Scheduler and Dispatcher
Prepared By: Ghayour Abbas
Scheduler and Dispatcher are associated with the process scheduling of an operating
system. Scheduling is the operating system's process to decide which process should be
allocated to the CPU to execute several processes.
The key difference between scheduler and Dispatcher is that the scheduler selects a
process out of several processes to be executed. In contrast, the Dispatcher allocates the
CPU for the selected process by the scheduler.
What is Scheduler in OS
Schedulers are special system software that handles process scheduling in various ways.
Their main task is to select the jobs to submit into the system and decide which process
to run. There are three types of schedulers in an operating system.
1. Long Term Scheduler: It is also called a job scheduler. A long-term scheduler determines
which programs are admitted to the system for processing. It selects processes from the
queue and loads them into memory for execution. Process loads into the memory for
CPU scheduling.
The primary objective of the job scheduler is to provide a balanced mix of jobs, such as
I/O bound and processor bound. It also controls the degree of multiprogramming. If the
degree of multiprogramming is stable, then the average rate of process creation must be
equal to the average departure rate of processes leaving the system.
On some systems, the long-term scheduler may not be available or minimal, and Time-
sharing operating systems have no long term scheduler. When a process changes the
state from new to ready, there is a long-term scheduler.
2. Short Term Scheduler: It is also called a CPU scheduler. Its main objective is to increase
system performance under the chosen set of criteria. It is the change of ready state to
running state of the process. CPU scheduler selects a process among the processes that
are ready to execute and allocates CPU to one of them.
Short-term schedulers, also known as dispatchers, decide which process to execute next.
Short-term schedulers are faster than long-term schedulers.
3. Medium Term Scheduler: Medium-term scheduling is a part of swapping. It removes the
processes from memory, and it reduces the degree of multiprogramming. The medium-
term scheduler is in charge of handling the swapped out processes.
A running process may become suspended if it makes an I/O request, and a suspended
process cannot make any progress towards completion. In this condition, the suspended
process is moved to the secondary storage to remove the process from memory and
make space for other processes. This process is called swapping, and the process is said to
be swapped out or rolled out. Swapping may be necessary to improve the process mix.
What is Dispatcher in OS
A dispatcher is a special program that comes into play after the scheduler. 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., and then the CPU is allocated to some other process.
This switching of CPU from one process to the other is called 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 the ready state to
the running state.
The Dispatcher needs to be as fast as possible, as it is run on every context switch. The
time consumed by the Dispatcher is known as dispatch latency.
Sometimes, the Dispatcher is considered part of the short-term scheduler, so the whole
unit is called the short-term scheduler. In this scenario, the task of the short term
scheduler is to select a process from the ready queue and allocate the CPU for that
process. In the operating system, a dispatcher has the following responsibilities:
o Switching to user mode: All of the low-level operating system processes run on the kernel
level security access, but all application code and user issued processes run in the
application space or the user permission mode. The Dispatcher switches the processes to
the user mode.
o Addressing: The program counter (PC) register points towards the next process to be
executed. The Dispatcher is responsible for addressing that address.
o Initiation of context switch: A context switch is when a currently running process is
halted, and all of its data and its process control block (PCB) are stored in the main
memory, and another process is loaded in its place for execution.
o Managing dispatch latency: Dispatch latency is calculated as the time it takes to stop one
process and start another. The lower the dispatch latency, the more efficient the software
for the same hardware configuration.
Example of Scheduler and Dispatcher
Suppose four processes, P1, P2, P3, and P4, are in the ready queue. Their arrival times are
T1, T2, T3, and T4, respectively. And a First in, First out (FIFO) scheduling algorithm is used
in this whole process or task.
The process P1 arrived first, so the scheduler will decide it is the first process to be
executed, and the Dispatcher will remove P1 from the ready queue and give it to the CPU.
Then the scheduler will determine process 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
process P2 and give it to the CPU. This continues in the same way for process P3 and then
P4.
Difference between Scheduler and Dispatcher in Operating System
The CPU cannot execute all processes residing in the ready queue and waiting for
execution simultaneously. So the operating system has to choose a particular process
based on the scheduling algorithm, and the scheduler does this procedure of selecting a
process among various processes.
Once the scheduler has selected a process from the queue, the Dispatcher takes it 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.
Scheduler and Dispatcher are used in the process scheduling of an operating system, and
they both complete the same process or task. Still, the difference between scheduler and
Dispatcher is that the scheduler selects a process out of several processes to be executed.
In contrast, the Dispatcher allocates the CPU for the selected process by the scheduler.
There are some more differences between the scheduler and the Dispatcher in the
operating system, such as:
Properties Scheduler Dispatcher
Definition The scheduler is special system software
that handles process scheduling by
selecting the process to execute.
The Dispatcher is a module that controls the
CPU to the process selected by the short term
scheduler.
Algorithm The scheduler works on various algorithms
such as FCFS, SJF, RR etc.
The Dispatcher has no specific algorithm for
its implementation.
Types There are three types of schedulers, such
as Long-term, Short-term, Medium-term.
There are no different types in Dispatcher,
and it is just a code segment.
Dependency The scheduler works independently, and it
works immediately when needed.
The working of a Dispatcher depends on a
scheduler, which means Dispatcher has to
wait until the scheduler selects a process.
Time Taken Time taken by the scheduler is usually
negligible.
The time taken by the Dispatcher is called
dispatch latency.
Functions The only work of the scheduler is a
selection of processes.
A dispatcher is also responsible for Context
Switching, Switch to user mode, and Jumping
to the proper location when the process
restarted again.
Tasks The scheduler performs the task in three
stages, such as:
o The long-term schedulerselects the
process from the job queue and
brings it to the ready queue.
o The short term schedulerselects a
process in the ready queue.
o The medium schedulercarries out
the swap in, swap out of the
process.
The Dispatcher allocates the CPU to the
process selected by the short-term scheduler.

More Related Content

What's hot

Open source operating systems
Open source operating systemsOpen source operating systems
Open source operating systems
Tushar B Kute
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
RajendraPrasad Alladi
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linux
Siddique Ibrahim
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)Imdad Ullah
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
Vpmv
 
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1
abhinav baba
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Chankey Pathak
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
NEERAJ BAGHEL
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Process management
Process managementProcess management
Process management
Birju Tank
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
vampugani
 
Unix case-study
Unix case-studyUnix case-study
Unix case-study
NishantMishra126
 
Linux file system
Linux file systemLinux file system
Linux file system
Md. Tanvir Hossain
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
Wayne Jones Jnr
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
Dr Sandeep Kumar Poonia
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
Damian T. Gordon
 
Chapter 2 operating systems
Chapter 2 operating systemsChapter 2 operating systems
Chapter 2 operating systems
Praveen M Jigajinni
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering myrajendra
 
Operating system Tutorial.
Operating system Tutorial.Operating system Tutorial.
Operating system Tutorial.
Deepak Prasad India
 

What's hot (20)

Open source operating systems
Open source operating systemsOpen source operating systems
Open source operating systems
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linux
 
cpu scheduling OS
 cpu scheduling OS cpu scheduling OS
cpu scheduling OS
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
 
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Process management
Process managementProcess management
Process management
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Unix case-study
Unix case-studyUnix case-study
Unix case-study
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Chapter 2 operating systems
Chapter 2 operating systemsChapter 2 operating systems
Chapter 2 operating systems
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering
 
Operating system Tutorial.
Operating system Tutorial.Operating system Tutorial.
Operating system Tutorial.
 

Similar to CSI-503 - 13. Scheduler and Dispatcher

RDos.pptx
RDos.pptxRDos.pptx
RDos.pptx
RRamyaDevi
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
Deepika Balichwal
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaion
inayat khan
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling.pptx
Process scheduling.pptxProcess scheduling.pptx
Process scheduling.pptx
MSivani
 
CSI-503 - 3. Process Scheduling
CSI-503 - 3. Process SchedulingCSI-503 - 3. Process Scheduling
CSI-503 - 3. Process Scheduling
ghayour abbas
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
A. S. M. Shafi
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
AyushSharma651966
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
Krupali Mistry
 
Operating System
Operating SystemOperating System
Operating System
GowriLatha1
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2) rohassanie
 
operating system 1.1.pdf
operating system 1.1.pdfoperating system 1.1.pdf
operating system 1.1.pdf
Billylesaigor
 
52bf066dbfcc4d739fa99d255dba287a.pptx
52bf066dbfcc4d739fa99d255dba287a.pptx52bf066dbfcc4d739fa99d255dba287a.pptx
52bf066dbfcc4d739fa99d255dba287a.pptx
11SnehlataGujar
 
Multi-Threading.pptx
Multi-Threading.pptxMulti-Threading.pptx
Multi-Threading.pptx
CHANDRUG31
 
Operating System.pptx
Operating System.pptxOperating System.pptx
Operating System.pptx
VanshikaRajput33
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...
ApurvaLaddha
 
Lecture 4 process cpu scheduling
Lecture 4   process cpu schedulingLecture 4   process cpu scheduling
Lecture 4 process cpu scheduling
Kumbirai Junior Muzavazi
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
DivyaKS18
 
OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
Rakibul Rakib
 

Similar to CSI-503 - 13. Scheduler and Dispatcher (20)

RDos.pptx
RDos.pptxRDos.pptx
RDos.pptx
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaion
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Process scheduling.pptx
Process scheduling.pptxProcess scheduling.pptx
Process scheduling.pptx
 
CSI-503 - 3. Process Scheduling
CSI-503 - 3. Process SchedulingCSI-503 - 3. Process Scheduling
CSI-503 - 3. Process Scheduling
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Operating System
Operating SystemOperating System
Operating System
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
operating system 1.1.pdf
operating system 1.1.pdfoperating system 1.1.pdf
operating system 1.1.pdf
 
52bf066dbfcc4d739fa99d255dba287a.pptx
52bf066dbfcc4d739fa99d255dba287a.pptx52bf066dbfcc4d739fa99d255dba287a.pptx
52bf066dbfcc4d739fa99d255dba287a.pptx
 
Multi-Threading.pptx
Multi-Threading.pptxMulti-Threading.pptx
Multi-Threading.pptx
 
Operating System.pptx
Operating System.pptxOperating System.pptx
Operating System.pptx
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...
 
Lecture 4 process cpu scheduling
Lecture 4   process cpu schedulingLecture 4   process cpu scheduling
Lecture 4 process cpu scheduling
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
 

More from ghayour abbas

TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
ghayour abbas
 
Web Development 5
Web Development 5 Web Development 5
Web Development 5
ghayour abbas
 
Web Development 4
Web Development 4Web Development 4
Web Development 4
ghayour abbas
 
Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)
ghayour abbas
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
ghayour abbas
 
Lab Manual CSI-321
Lab Manual CSI-321Lab Manual CSI-321
Lab Manual CSI-321
ghayour abbas
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)
ghayour abbas
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)
ghayour abbas
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
ghayour abbas
 
SWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing OverviewSWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing Overview
ghayour abbas
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementation
ghayour abbas
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
ghayour abbas
 
SWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design StrategiesSWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design Strategies
ghayour abbas
 
SWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design BasicsSWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design Basics
ghayour abbas
 
SWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design ToolsSWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design Tools
ghayour abbas
 
SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications
ghayour abbas
 
SWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project ManagementSWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project Management
ghayour abbas
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
ghayour abbas
 
CSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationCSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronization
ghayour abbas
 
CSI-503 - 2. Processor Management
CSI-503 - 2. Processor ManagementCSI-503 - 2. Processor Management
CSI-503 - 2. Processor Management
ghayour abbas
 

More from ghayour abbas (20)

TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
Web Development 5
Web Development 5 Web Development 5
Web Development 5
 
Web Development 4
Web Development 4Web Development 4
Web Development 4
 
Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
 
Lab Manual CSI-321
Lab Manual CSI-321Lab Manual CSI-321
Lab Manual CSI-321
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
 
SWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing OverviewSWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing Overview
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementation
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
 
SWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design StrategiesSWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design Strategies
 
SWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design BasicsSWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design Basics
 
SWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design ToolsSWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design Tools
 
SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications
 
SWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project ManagementSWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project Management
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 
CSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationCSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronization
 
CSI-503 - 2. Processor Management
CSI-503 - 2. Processor ManagementCSI-503 - 2. Processor Management
CSI-503 - 2. Processor Management
 

Recently uploaded

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

CSI-503 - 13. Scheduler and Dispatcher

  • 1. 13 Scheduler and Dispatcher Prepared By: Ghayour Abbas Scheduler and Dispatcher are associated with the process scheduling of an operating system. Scheduling is the operating system's process to decide which process should be allocated to the CPU to execute several processes. The key difference between scheduler and Dispatcher is that the scheduler selects a process out of several processes to be executed. In contrast, the Dispatcher allocates the CPU for the selected process by the scheduler. What is Scheduler in OS Schedulers are special system software that handles process scheduling in various ways. Their main task is to select the jobs to submit into the system and decide which process to run. There are three types of schedulers in an operating system. 1. Long Term Scheduler: It is also called a job scheduler. A long-term scheduler determines which programs are admitted to the system for processing. It selects processes from the queue and loads them into memory for execution. Process loads into the memory for CPU scheduling. The primary objective of the job scheduler is to provide a balanced mix of jobs, such as I/O bound and processor bound. It also controls the degree of multiprogramming. If the degree of multiprogramming is stable, then the average rate of process creation must be equal to the average departure rate of processes leaving the system. On some systems, the long-term scheduler may not be available or minimal, and Time-
  • 2. sharing operating systems have no long term scheduler. When a process changes the state from new to ready, there is a long-term scheduler. 2. Short Term Scheduler: It is also called a CPU scheduler. Its main objective is to increase system performance under the chosen set of criteria. It is the change of ready state to running state of the process. CPU scheduler selects a process among the processes that are ready to execute and allocates CPU to one of them. Short-term schedulers, also known as dispatchers, decide which process to execute next. Short-term schedulers are faster than long-term schedulers. 3. Medium Term Scheduler: Medium-term scheduling is a part of swapping. It removes the processes from memory, and it reduces the degree of multiprogramming. The medium- term scheduler is in charge of handling the swapped out processes. A running process may become suspended if it makes an I/O request, and a suspended process cannot make any progress towards completion. In this condition, the suspended process is moved to the secondary storage to remove the process from memory and make space for other processes. This process is called swapping, and the process is said to be swapped out or rolled out. Swapping may be necessary to improve the process mix.
  • 3. What is Dispatcher in OS A dispatcher is a special program that comes into play after the scheduler. 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., and then the CPU is allocated to some other process. This switching of CPU from one process to the other is called 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 the ready state to the running state. The Dispatcher needs to be as fast as possible, as it is run on every context switch. The time consumed by the Dispatcher is known as dispatch latency. Sometimes, the Dispatcher is considered part of the short-term scheduler, so the whole unit is called the short-term scheduler. In this scenario, the task of the short term scheduler is to select a process from the ready queue and allocate the CPU for that process. In the operating system, a dispatcher has the following responsibilities: o Switching to user mode: All of the low-level operating system processes run on the kernel level security access, but all application code and user issued processes run in the application space or the user permission mode. The Dispatcher switches the processes to the user mode. o Addressing: The program counter (PC) register points towards the next process to be executed. The Dispatcher is responsible for addressing that address.
  • 4. o Initiation of context switch: A context switch is when a currently running process is halted, and all of its data and its process control block (PCB) are stored in the main memory, and another process is loaded in its place for execution. o Managing dispatch latency: Dispatch latency is calculated as the time it takes to stop one process and start another. The lower the dispatch latency, the more efficient the software for the same hardware configuration. Example of Scheduler and Dispatcher Suppose four processes, P1, P2, P3, and P4, are in the ready queue. Their arrival times are T1, T2, T3, and T4, respectively. And a First in, First out (FIFO) scheduling algorithm is used in this whole process or task. The process P1 arrived first, so the scheduler will decide it is the first process to be executed, and the Dispatcher will remove P1 from the ready queue and give it to the CPU. Then the scheduler will determine process 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 process P2 and give it to the CPU. This continues in the same way for process P3 and then P4. Difference between Scheduler and Dispatcher in Operating System The CPU cannot execute all processes residing in the ready queue and waiting for execution simultaneously. So the operating system has to choose a particular process based on the scheduling algorithm, and the scheduler does this procedure of selecting a process among various processes. Once the scheduler has selected a process from the queue, the Dispatcher takes it 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.
  • 5. Scheduler and Dispatcher are used in the process scheduling of an operating system, and they both complete the same process or task. Still, the difference between scheduler and Dispatcher is that the scheduler selects a process out of several processes to be executed. In contrast, the Dispatcher allocates the CPU for the selected process by the scheduler. There are some more differences between the scheduler and the Dispatcher in the operating system, such as: Properties Scheduler Dispatcher Definition The scheduler is special system software that handles process scheduling by selecting the process to execute. The Dispatcher is a module that controls the CPU to the process selected by the short term scheduler. Algorithm The scheduler works on various algorithms such as FCFS, SJF, RR etc. The Dispatcher has no specific algorithm for its implementation. Types There are three types of schedulers, such as Long-term, Short-term, Medium-term. There are no different types in Dispatcher, and it is just a code segment. Dependency The scheduler works independently, and it works immediately when needed. The working of a Dispatcher depends on a scheduler, which means Dispatcher has to wait until the scheduler selects a process. Time Taken Time taken by the scheduler is usually negligible. The time taken by the Dispatcher is called dispatch latency. Functions The only work of the scheduler is a selection of processes. A dispatcher is also responsible for Context Switching, Switch to user mode, and Jumping to the proper location when the process restarted again. Tasks The scheduler performs the task in three stages, such as: o The long-term schedulerselects the process from the job queue and brings it to the ready queue. o The short term schedulerselects a process in the ready queue. o The medium schedulercarries out the swap in, swap out of the process. The Dispatcher allocates the CPU to the process selected by the short-term scheduler.