SlideShare a Scribd company logo
4
Most read
9
Most read
13
Most read
SCHEDULING
ALGORITHMS
MARGRAT C R
S5 CSE-B
21
A Process Scheduler schedules different processes to be assigned to the CPU based on
particular scheduling algorithms. There are five popular process scheduling
algorithms
• First-Come, First-Served (FCFS) Scheduling
• Shortest-Job-Next (SJN) Scheduling
• Priority Scheduling
• Round Robin(RR) Scheduling
• Multiple-Level Queues Scheduling
 These algorithms are either non-preemptive or preemptive.
 Non-preemptive algorithms are designed so that once a process enters the running state,
it cannot be preempted until it completes its allotted time,
 whereas the preemptive scheduling is based on priority where a scheduler may preempt
a low priority running process anytime when a high priority process enters into a ready
state.
First Come First Serve (FCFS)
• Jobs are executed on first come, first serve basis.
• It is a non-preemptive scheduling algorithm.
• Easy to understand and implement.
• Its implementation is based on FIFO queue.
• Poor in performance as average wait time is high.
SCHEDULING ALGORITHMS
Process Wait Time : Service Time - Arrival Time
P0 0 - 0 = 0
P1 5 - 1 = 4
P2 8 - 2 = 6
P3 16 - 3 = 13
Average Wait Time: (0+4+6+13) / 4 = 5.75
Shortest Job Next (SJN)
 This is also known as shortest job first, or SJF
 This is a non-preemptive scheduling algorithm.
 Best approach to minimize waiting time.
 Easy to implement in Batch systems where required CPU time is known in advance.
 Impossible to implement in interactive systems where required CPU time is not known.
 The processer should know in advance how much time process will take.
SCHEDULING ALGORITHMS
Process Wait Time : Service Time - Arrival Time
P0 3 - 0 = 3
P1 0 - 0 = 0
P2 16 - 2 = 14
P3 8 - 3 = 5
Average Wait Time: (3+0+14+5) / 4 = 5.50
Priority Based Scheduling
 Priority scheduling is a non-preemptive algorithm and one of the most common scheduling
algorithms in batch systems.
 Each process is assigned a priority. Process with highest priority is to be executed first and so
on.
 Processes with same priority are executed on first come first served basis.
 Priority can be decided based on memory requirements, time requirements or any other
resource requirement.
SCHEDULING ALGORITHMS
Process Wait Time : Service Time - Arrival Time
P0 9 - 0 = 9
P1 6 - 1 = 5
P2 14 - 2 = 12
P3 0 - 0 = 0
Average Wait Time: (9+5+12+0) / 4 = 6.5
Round Robin Scheduling
 Round Robin is the preemptive process scheduling algorithm.
 Each process is provided a fix time to execute, it is called a quantum.
 Once a process is executed for a given time period, it is preempted and other
process executes for a given time period.
 Context switching is used to save states of preempted processes
SCHEDULING ALGORITHMS
Process Wait Time : Service Time - Arrival Time
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P2 (6 - 2) + (14 - 9) + (20 - 17) = 12
P3 (9 - 3) + (17 - 12) = 11
Average Wait Time: (9+2+12+11) / 4 = 8.5
Multiple-Level Queues Scheduling
Multiple-level queues are not an independent scheduling algorithm. They make use of other existing
algorithms to group and schedule jobs with common characteristics.
• Multiple queues are maintained for processes with common characteristics.
• Each queue can have its own scheduling algorithms.
• Priorities are assigned to each queue.
For example, CPU-bound jobs can be scheduled in one queue and all I/O-bound jobs in another queue.
The Process Scheduler then alternately selects jobs from each queue and assigns them to the CPU based
on the algorithm assigned to the queue.
SCHEDULING ALGORITHMS

More Related Content

PDF
Process scheduling (CPU Scheduling)
PPTX
CPU scheduling algorithms in OS
PDF
CS6401 OPERATING SYSTEMS Unit 2
PPT
Scheduling algorithms
PDF
Notes on NUMA architecture
PPTX
Cache memory ppt
PPTX
Cpu scheduling
Process scheduling (CPU Scheduling)
CPU scheduling algorithms in OS
CS6401 OPERATING SYSTEMS Unit 2
Scheduling algorithms
Notes on NUMA architecture
Cache memory ppt
Cpu scheduling

What's hot (20)

PDF
OS - Process Concepts
PPTX
5_Interprocess Communication.pptx
PPTX
Computer architecture memory system
PPT
Parallel Computing
PPT
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
PPTX
Cache memory
PPTX
Concurrency Control in Distributed Systems.pptx
PPT
Operating System-Threads-Galvin
PDF
9 virtual memory management
PPT
remote procedure calls
PPT
OS Process and Thread Concepts
PPTX
Process management in operating system | process states | PCB | FORK() | Zomb...
PPT
Memory Management in OS
PPTX
Operating system components
PPT
Chapter 3: Processes
PPTX
Computer arithmetic
PPTX
Cache management
PDF
Comparision of scheduling algorithms
PPTX
Cache memory
OS - Process Concepts
5_Interprocess Communication.pptx
Computer architecture memory system
Parallel Computing
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
Cache memory
Concurrency Control in Distributed Systems.pptx
Operating System-Threads-Galvin
9 virtual memory management
remote procedure calls
OS Process and Thread Concepts
Process management in operating system | process states | PCB | FORK() | Zomb...
Memory Management in OS
Operating system components
Chapter 3: Processes
Computer arithmetic
Cache management
Comparision of scheduling algorithms
Cache memory
Ad

Viewers also liked (11)

PPTX
Operating system
PPSX
CPU Scheduling algorithms
PPTX
Srt algorithm
PPT
Lru Stack
PPTX
Process scheduling in Light weight weight and Heavy weight processes.
PPTX
Operating Systems: Process Scheduling
PPT
Page Replacement
PPT
Page replacement
PDF
5 Process Scheduling
PPT
CPU Scheduling Algorithms
PPTX
Page replacement algorithms
Operating system
CPU Scheduling algorithms
Srt algorithm
Lru Stack
Process scheduling in Light weight weight and Heavy weight processes.
Operating Systems: Process Scheduling
Page Replacement
Page replacement
5 Process Scheduling
CPU Scheduling Algorithms
Page replacement algorithms
Ad

Similar to SCHEDULING ALGORITHMS (20)

PDF
operating system (1).pdf
PPTX
Dos.pptx
PPT
chapter 5 CPU scheduling.ppt
PPT
Process management in os
PDF
cpu scheduling.pdf
PDF
cpu schduling ppt.pdf
PPT
Process Scheduling in Ope Spptystems rating
PPT
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
PPT
Operating System 5
PDF
cpu scheduling.pdfoieheoirwuojorkjp;ooooo
PPT
Cpu scheduling
PPTX
Process scheduling
PPT
scheduling Uni processor Long-term .ppt
PPT
Operating System Scheduling
PPTX
Lecture 4 process cpu scheduling
PPT
OS-operating systems- ch05 (CPU Scheduling) ...
PPT
Ch05 cpu-scheduling
PPTX
Operating Systems - CPU Scheduling Process
PPT
scheduling-algorithms.ppt
PDF
scheduling-algorithms.pdf
operating system (1).pdf
Dos.pptx
chapter 5 CPU scheduling.ppt
Process management in os
cpu scheduling.pdf
cpu schduling ppt.pdf
Process Scheduling in Ope Spptystems rating
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
Operating System 5
cpu scheduling.pdfoieheoirwuojorkjp;ooooo
Cpu scheduling
Process scheduling
scheduling Uni processor Long-term .ppt
Operating System Scheduling
Lecture 4 process cpu scheduling
OS-operating systems- ch05 (CPU Scheduling) ...
Ch05 cpu-scheduling
Operating Systems - CPU Scheduling Process
scheduling-algorithms.ppt
scheduling-algorithms.pdf

Recently uploaded (20)

PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPT
Project quality management in manufacturing
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Construction Project Organization Group 2.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Well-logging-methods_new................
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
Structs to JSON How Go Powers REST APIs.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Internet of Things (IOT) - A guide to understanding
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
CH1 Production IntroductoryConcepts.pptx
Project quality management in manufacturing
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Arduino robotics embedded978-1-4302-3184-4.pdf
Construction Project Organization Group 2.pptx
573137875-Attendance-Management-System-original
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Well-logging-methods_new................
Foundation to blockchain - A guide to Blockchain Tech
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CYBER-CRIMES AND SECURITY A guide to understanding

SCHEDULING ALGORITHMS

  • 2. A Process Scheduler schedules different processes to be assigned to the CPU based on particular scheduling algorithms. There are five popular process scheduling algorithms • First-Come, First-Served (FCFS) Scheduling • Shortest-Job-Next (SJN) Scheduling • Priority Scheduling • Round Robin(RR) Scheduling • Multiple-Level Queues Scheduling  These algorithms are either non-preemptive or preemptive.  Non-preemptive algorithms are designed so that once a process enters the running state, it cannot be preempted until it completes its allotted time,  whereas the preemptive scheduling is based on priority where a scheduler may preempt a low priority running process anytime when a high priority process enters into a ready state.
  • 3. First Come First Serve (FCFS) • Jobs are executed on first come, first serve basis. • It is a non-preemptive scheduling algorithm. • Easy to understand and implement. • Its implementation is based on FIFO queue. • Poor in performance as average wait time is high.
  • 5. Process Wait Time : Service Time - Arrival Time P0 0 - 0 = 0 P1 5 - 1 = 4 P2 8 - 2 = 6 P3 16 - 3 = 13 Average Wait Time: (0+4+6+13) / 4 = 5.75
  • 6. Shortest Job Next (SJN)  This is also known as shortest job first, or SJF  This is a non-preemptive scheduling algorithm.  Best approach to minimize waiting time.  Easy to implement in Batch systems where required CPU time is known in advance.  Impossible to implement in interactive systems where required CPU time is not known.  The processer should know in advance how much time process will take.
  • 8. Process Wait Time : Service Time - Arrival Time P0 3 - 0 = 3 P1 0 - 0 = 0 P2 16 - 2 = 14 P3 8 - 3 = 5 Average Wait Time: (3+0+14+5) / 4 = 5.50
  • 9. Priority Based Scheduling  Priority scheduling is a non-preemptive algorithm and one of the most common scheduling algorithms in batch systems.  Each process is assigned a priority. Process with highest priority is to be executed first and so on.  Processes with same priority are executed on first come first served basis.  Priority can be decided based on memory requirements, time requirements or any other resource requirement.
  • 11. Process Wait Time : Service Time - Arrival Time P0 9 - 0 = 9 P1 6 - 1 = 5 P2 14 - 2 = 12 P3 0 - 0 = 0 Average Wait Time: (9+5+12+0) / 4 = 6.5
  • 12. Round Robin Scheduling  Round Robin is the preemptive process scheduling algorithm.  Each process is provided a fix time to execute, it is called a quantum.  Once a process is executed for a given time period, it is preempted and other process executes for a given time period.  Context switching is used to save states of preempted processes
  • 14. Process Wait Time : Service Time - Arrival Time P0 (0 - 0) + (12 - 3) = 9 P1 (3 - 1) = 2 P2 (6 - 2) + (14 - 9) + (20 - 17) = 12 P3 (9 - 3) + (17 - 12) = 11 Average Wait Time: (9+2+12+11) / 4 = 8.5
  • 15. Multiple-Level Queues Scheduling Multiple-level queues are not an independent scheduling algorithm. They make use of other existing algorithms to group and schedule jobs with common characteristics. • Multiple queues are maintained for processes with common characteristics. • Each queue can have its own scheduling algorithms. • Priorities are assigned to each queue. For example, CPU-bound jobs can be scheduled in one queue and all I/O-bound jobs in another queue. The Process Scheduler then alternately selects jobs from each queue and assigns them to the CPU based on the algorithm assigned to the queue.