SlideShare a Scribd company logo
1 of 35
CPU Scheduling Chapter 5
CPU Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basic Concepts ,[object Object],[object Object],[object Object]
CPU-I/O Burst Cycle Process A Process B
Histogram of CPU-burst Times
Schedulers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CPU Scheduler ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dispatcher ,[object Object],[object Object],[object Object],[object Object],[object Object]
Scheduling Criteria ,[object Object],[object Object],[object Object],[object Object],[object Object]
“ The perfect CPU scheduler” ,[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithms
Scheduling Algorithms FCFS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
First Come First Served Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Waiting time for  P 1   = 0;  P 2   = 24;  P 3  = 27 Average waiting time:  (0 + 24 + 27)/3 = 17 Waiting time for  P 1  =  6 ;   P 2  = 0 ;  P 3  =  3 Average waiting time:  (6 + 0 + 3)/3 = 3 P 1 P 3 P 2 6 3 30 0 P 1 P 2 P 3 24 27 30 0
Shortest-Job-First (SJR) Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Shortest Job First Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],P 1 P 3 P 2 7 P 1 (7) 16 0 P 4 8 12 Average waiting time = (0 + 6 + 3 + 7)/4 = 4 2 4 5 P 2 (4) P 3 (1) P 4 (4) P 1 ‘s wating time = 0 P 2 ‘s wating time = 6 P 3 ‘s wating time = 3 P 4 ‘s wating time = 7
Shortest Job First Scheduling Cont’d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Average waiting time = (9 + 1 + 0 +2)/4 = 3 P 1 (7) P 2 (4) P 3 (1) P 4 (4) P 1 ‘s wating time = 9 P 2 ‘s wating time = 1 P 3 ‘s wating time = 0 P 4 ‘s wating time = 2 P 1 (5) P 2 (2) P 1 P 3 P 2 4 2 11 0 P 4 5 7 P 2 P 1 16
Shortest Job First Scheduling Cont’d ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Shortest Job First Scheduling Cont’d
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Priority Scheduling
Round Robin (RR) ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Round Robin Scheduling Average wait time = (81+20+94+97)/4 = 73 57 20 37 57 24 40 40 17 P 1 (53) P 2 (17) P 3 (68) P 4 (24) P 1 (33) P 1 (13) P 3 (48) P 3 (28) P 3 (8) P 4 (4) P 1 P 2 P 3 P 4 P 1 P 3 P 4 P 1 P 3 P 3 0 20 37 57 77 97 117 121 134 154 162
[object Object],[object Object],[object Object],[object Object],Round Robin Scheduling
Turnaround Time Varies With The Time Quantum TAT can be improved if most process finish their next CPU burst in a single time quantum.
Multilevel Queue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multilevel Queue Scheduling
Multi-level Feedback Queues ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example of Multilevel Feedback Queue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multilevel Feedback Queues
Multiple-Processor Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thread Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Linux Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Relationship Between Priorities and Time-slice length
List of Tasks Indexed According to Prorities
Conclusion ,[object Object],[object Object],[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
myrajendra
 

What's hot (20)

Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatz
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Process scheduling algorithms
Process scheduling algorithmsProcess scheduling algorithms
Process scheduling algorithms
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Unit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process SynchronizationUnit II - 3 - Operating System - Process Synchronization
Unit II - 3 - Operating System - Process Synchronization
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
Context switching
Context switchingContext switching
Context switching
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT V Real Time Operating System (RTOS)
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT V  Real Time Operating System (RTOS)SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT V  Real Time Operating System (RTOS)
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT V Real Time Operating System (RTOS)
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
MULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULINGMULTILEVEL QUEUE SCHEDULING
MULTILEVEL QUEUE SCHEDULING
 

Viewers also liked

Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
Vaibhav Bajaj
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Tutorial4 Threads
Tutorial4  ThreadsTutorial4  Threads
Tutorial4 Threads
tech2click
 
Stroustrup c++0x overview
Stroustrup c++0x overviewStroustrup c++0x overview
Stroustrup c++0x overview
Vaibhav Bajaj
 

Viewers also liked (20)

Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Sa by shekhar
Sa by shekharSa by shekhar
Sa by shekhar
 
Os module 2 ba
Os module 2 baOs module 2 ba
Os module 2 ba
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Ch05
Ch05Ch05
Ch05
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threads
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
CPU Scheduling - Part1
CPU Scheduling - Part1CPU Scheduling - Part1
CPU Scheduling - Part1
 
Memory management
Memory managementMemory management
Memory management
 
Tutorial4 Threads
Tutorial4  ThreadsTutorial4  Threads
Tutorial4 Threads
 
Stroustrup c++0x overview
Stroustrup c++0x overviewStroustrup c++0x overview
Stroustrup c++0x overview
 
Mid1 Revision
Mid1  RevisionMid1  Revision
Mid1 Revision
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Operating System Concepts
Operating System ConceptsOperating System Concepts
Operating System Concepts
 

Similar to Operating System 5 (20)

OSCh6
OSCh6OSCh6
OSCh6
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
Ch5
Ch5Ch5
Ch5
 
Ch6
Ch6Ch6
Ch6
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2
 
Os..
Os..Os..
Os..
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
 
Cpu_sheduling.pptx
Cpu_sheduling.pptxCpu_sheduling.pptx
Cpu_sheduling.pptx
 
csc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfcsc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdf
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
Os2
Os2Os2
Os2
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 

More from tech2click (11)

Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Ch13
Ch13Ch13
Ch13
 
Ch12
Ch12Ch12
Ch12
 
Ch11
Ch11Ch11
Ch11
 
Ch10
Ch10Ch10
Ch10
 
Ch8
Ch8Ch8
Ch8
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Operating System 2
Operating System 2Operating System 2
Operating System 2
 
Rootkit
RootkitRootkit
Rootkit
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

Operating System 5