SlideShare a Scribd company logo
Scheduling Criteria CPU utilization  – keep the CPU as busy as possible (from 0% to  100%) Throughput  – # of processes that complete their execution per  time unit Turnaround time  – amount of time to execute a particular  Process Waiting time  – amount of time a process has been waiting in the  ready queue Response time  – amount of time it takes from when a request was submitted until the first response is produced
Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min Response time
Scheduling Algorithems First Come First Serve Scheduling  Shortest Job First Scheduling  Priority Scheduling  Round-Robin Scheduling  Multilevel Queue Scheduling   Multilevel Feedback-Queue Scheduling
First Come First Serve Scheduling (FCFS) Process   Burst time P1  24 P2  3 P2  3
First Come First Serve Scheduling The average of waiting time in this policy is usually quite long Waiting time for P1=0; P2=24; P3=27 Average waiting time= (0+24+27)/3=17
First Come First Serve Scheduling Suppose we change the order of arriving job P2, P3, P1
First Come First Serve Scheduling Consider if we have a CPU-bound process and many I/O-bound processes There is a  convoy effect  as all the other processes waiting for one of the big process to get off the CPU FCFS scheduling algorithm is non-preemptive
Short job first scheduling (SJF) This algorithm associates with each process the length of the processes’ next CPU burst  If there is a tie, FCFS is used In other words, this algorithm can be also regard as shortest-next-cpu-burst algorithm
Short job first scheduling SJF is optimal – gives minimum average waiting time for a given set of processes
Example Processes   Burst time P1  6 P2  8 P3  7 P4  3 FCFS average waiting time: (0+6+14+21)/4=10.25 SJF  average waiting time: (3+16+9+0)/4=7
Short job first scheduling Two schemes: Non-preemptive – once CPU given to the process it cannot be preempted until completes its CPU burst  Preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF)
Short job first scheduling- Non-preemptive
Short job first scheduling- Preemptive
Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority) Preemptive Non-preemptive SJF is a special priority scheduling where priority is the predicted next CPU burst time, so that it can decide the priority
Priority Scheduling Processes   Burst time   Priority   Arrival time  P1  10  3 P2  1  1 P3  2  4 P4  1  5  P5  5  2 The average waiting time=(6+0+16+18+1)/5=8.2
Priority Scheduling Processes   Burst time   Priority   Arrival time  P1  10  3  0.0 P2  1  1  1.0 P3  2  4  2.0 P4  1  5  3.0 P5  5  2  4.0 Gantt chart for both preemptive and non-preemptive, also waiting time
Priority Scheduling Problem : Starvation – low priority processes may never execute Solution : Aging – as time progresses increase the priority of the process
Round-Robin Scheduling The Round-Robin is designed especially for time sharing systems.  It is similar FCFS but add preemption concept A small unit of time, called  time quantum , is defined
Round-Robin Scheduling Each process gets a small unit of CPU time ( time quantum ), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.
Round-Robin Scheduling
Round-Robin Scheduling If there are  n  processes in the ready queue and the time quantum is  q , then each process gets 1/ n  of the CPU time in chunks of at most  q  time units at once. No process waits more than  ( n -1) q  time units.
Round-Robin Scheduling Performance q  large => FIFO q  small =>  q  must be large with respect to context switch, otherwise overhead is too high Typically, higher average turnaround than SJF, but better  response
Round-Robin Scheduling
Multilevel Queue Ready queue is partitioned into separate queues: foreground (interactive) background (batch) Each queue has its own scheduling algorithm foreground – RR    background – FCFS
Multilevel Queue example Foreground  P1  53  (RR interval:20) P2  17 P3  42 Background  P4  30  (FCFS) P5  20
Multilevel Queue Scheduling must be done between the queues Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. Time slice – each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR
Multilevel Queue
Multilevel Feedback Queue Three queues: Q 0 – RR with time quantum 8 milliseconds Q 1 – RR time quantum 16 milliseconds Q 2 – FCFS Scheduling A new job enters queue  Q0  which is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue  Q 1. At  Q 1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue  Q 2.
Multilevel Feedback Queue
Multilevel Feedback Queue P1  40 P2  35 P3  15
5.4 Multiple-Processor Scheduling We concentrate on systems in which the processors are identical (homogeneous) Asymmetric multiprocessing  (by one master) is simple because only one processor access the system data structures. Symmetric multiprocessing , each processor is self-scheduling.  Each processor may have their own ready queue.
Load balancing On symmetric multiprocessing systems, it is important to keep the workload balanced among all processors to fully utilized the benefits of having more than one CPU There are two general approached to load balancing:  Push Migration  and  Pull Migration
Symmetric Multithreading An alternative strategy for symmetric multithreading is to provide multiple logical processors (rather than physical) It’s called  hyperthreading technology  on Intel processors
Symmetric Multithreading The idea behind it is to create multiple logical processors on the same physical processor (sounds like two threads) But it is not software provide the feature, but hardware Each logical processor has its own architecture state, each logical processor is responsible for its own interrupt handling.
Symmetric Multithreading

More Related Content

PPT
OSCh6
Joe Christensen
 
PDF
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Universitas Pembangunan Panca Budi
 
PPT
Sa by shekhar
shekhar1991
 
PPTX
Cpu scheduling
Abhijith Reloaded
 
PDF
5 Process Scheduling
Dr. Loganathan R
 
PPT
Cp usched 2
nidsrajdev
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Universitas Pembangunan Panca Budi
 
Sa by shekhar
shekhar1991
 
Cpu scheduling
Abhijith Reloaded
 
5 Process Scheduling
Dr. Loganathan R
 
Cp usched 2
nidsrajdev
 

What's hot (20)

PDF
Process Scheduling
International Islamic University
 
PPTX
First-Come-First-Serve (FCFS)
nikeAthena
 
PPT
Scheduling algorithm (chammu)
Nagarajan
 
PPT
Os module 2 ba
Gichelle Amon
 
PPTX
Scheduling algo(by HJ)
Harshit Jain
 
PPT
Processor / CPU Scheduling
Izaz Roghani
 
PPTX
SCHEDULING ALGORITHMS
Margrat C R
 
PPT
Cpu scheduling(suresh)
Nagarajan
 
PPTX
Cpu scheduling
Karthick Sekar
 
PPT
17 cpu scheduling and scheduling criteria
myrajendra
 
PDF
Process Scheduling
Abhishek Nagar
 
PPT
Scheduling algorithms
Chankey Pathak
 
PDF
Os prj ppt
Charmi Chokshi
 
PPTX
Round robin scheduling
Raghav S
 
PDF
RR and priority scheduling
A. S. M. Shafi
 
PPTX
Scheduling Algorithms-R.D.Sivakumar
Sivakumar R D .
 
PPT
Cpu Scheduling Galvin
Sonali Chauhan
 
PDF
Scheduling
Mohd Arif
 
PPTX
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
David Evans
 
First-Come-First-Serve (FCFS)
nikeAthena
 
Scheduling algorithm (chammu)
Nagarajan
 
Os module 2 ba
Gichelle Amon
 
Scheduling algo(by HJ)
Harshit Jain
 
Processor / CPU Scheduling
Izaz Roghani
 
SCHEDULING ALGORITHMS
Margrat C R
 
Cpu scheduling(suresh)
Nagarajan
 
Cpu scheduling
Karthick Sekar
 
17 cpu scheduling and scheduling criteria
myrajendra
 
Process Scheduling
Abhishek Nagar
 
Scheduling algorithms
Chankey Pathak
 
Os prj ppt
Charmi Chokshi
 
Round robin scheduling
Raghav S
 
RR and priority scheduling
A. S. M. Shafi
 
Scheduling Algorithms-R.D.Sivakumar
Sivakumar R D .
 
Cpu Scheduling Galvin
Sonali Chauhan
 
Scheduling
Mohd Arif
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
David Evans
 
Ad

Similar to Os.. (20)

PPT
Operating System 5
tech2click
 
PPT
Process management in os
Miong Lazaro
 
PPT
Ch6
C.U
 
PDF
csc4320chapter5-2-101203002830-phpapp01.pdf
AkarshNag
 
PPT
cpu sechduling
gopi7
 
PDF
CH06.pdf
ImranKhan880955
 
PPT
Process Scheduling in Ope Spptystems rating
Aryan904173
 
PPT
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
ssuserc35fa4
 
PPTX
Week 5a.pptx of cpu scheduling operating system class
Alishan442314
 
PPTX
DISEÑO DE MEMORIA EN SISTEMAS DE INFORMACION DIGITALES
2021207019est
 
PPTX
Operating systems - Processes Scheduling
Dr. Chandrakant Divate
 
PPTX
Cpu_sheduling.pptx
satishkamble37
 
PDF
cpu scheduling.pdfoieheoirwuojorkjp;ooooo
baijusurya7
 
PDF
Process Scheduling Algorithms.pdf
Rakibul Rakib
 
PPT
Window scheduling algorithm
Binal Parekh
 
PPTX
CPU scheduling
Amir Khan
 
PPT
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
VADAPALLYPRAVEENKUMA1
 
PDF
Distributed Operating System_2
Dr Sandeep Kumar Poonia
 
DOC
Operating Systems Third Unit - Fourth Semester - Engineering
Yogesh Santhan
 
PPTX
Preemptive process example.pptx
jamilaltiti1
 
Operating System 5
tech2click
 
Process management in os
Miong Lazaro
 
Ch6
C.U
 
csc4320chapter5-2-101203002830-phpapp01.pdf
AkarshNag
 
cpu sechduling
gopi7
 
CH06.pdf
ImranKhan880955
 
Process Scheduling in Ope Spptystems rating
Aryan904173
 
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
ssuserc35fa4
 
Week 5a.pptx of cpu scheduling operating system class
Alishan442314
 
DISEÑO DE MEMORIA EN SISTEMAS DE INFORMACION DIGITALES
2021207019est
 
Operating systems - Processes Scheduling
Dr. Chandrakant Divate
 
Cpu_sheduling.pptx
satishkamble37
 
cpu scheduling.pdfoieheoirwuojorkjp;ooooo
baijusurya7
 
Process Scheduling Algorithms.pdf
Rakibul Rakib
 
Window scheduling algorithm
Binal Parekh
 
CPU scheduling
Amir Khan
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
VADAPALLYPRAVEENKUMA1
 
Distributed Operating System_2
Dr Sandeep Kumar Poonia
 
Operating Systems Third Unit - Fourth Semester - Engineering
Yogesh Santhan
 
Preemptive process example.pptx
jamilaltiti1
 
Ad

Recently uploaded (20)

PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 

Os..

  • 1. Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per time unit Turnaround time – amount of time to execute a particular Process Waiting time – amount of time a process has been waiting in the ready queue Response time – amount of time it takes from when a request was submitted until the first response is produced
  • 2. Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min Response time
  • 3. Scheduling Algorithems First Come First Serve Scheduling Shortest Job First Scheduling Priority Scheduling Round-Robin Scheduling Multilevel Queue Scheduling Multilevel Feedback-Queue Scheduling
  • 4. First Come First Serve Scheduling (FCFS) Process Burst time P1 24 P2 3 P2 3
  • 5. First Come First Serve Scheduling The average of waiting time in this policy is usually quite long Waiting time for P1=0; P2=24; P3=27 Average waiting time= (0+24+27)/3=17
  • 6. First Come First Serve Scheduling Suppose we change the order of arriving job P2, P3, P1
  • 7. First Come First Serve Scheduling Consider if we have a CPU-bound process and many I/O-bound processes There is a convoy effect as all the other processes waiting for one of the big process to get off the CPU FCFS scheduling algorithm is non-preemptive
  • 8. Short job first scheduling (SJF) This algorithm associates with each process the length of the processes’ next CPU burst If there is a tie, FCFS is used In other words, this algorithm can be also regard as shortest-next-cpu-burst algorithm
  • 9. Short job first scheduling SJF is optimal – gives minimum average waiting time for a given set of processes
  • 10. Example Processes Burst time P1 6 P2 8 P3 7 P4 3 FCFS average waiting time: (0+6+14+21)/4=10.25 SJF average waiting time: (3+16+9+0)/4=7
  • 11. Short job first scheduling Two schemes: Non-preemptive – once CPU given to the process it cannot be preempted until completes its CPU burst Preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF)
  • 12. Short job first scheduling- Non-preemptive
  • 13. Short job first scheduling- Preemptive
  • 14. Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority) Preemptive Non-preemptive SJF is a special priority scheduling where priority is the predicted next CPU burst time, so that it can decide the priority
  • 15. Priority Scheduling Processes Burst time Priority Arrival time P1 10 3 P2 1 1 P3 2 4 P4 1 5 P5 5 2 The average waiting time=(6+0+16+18+1)/5=8.2
  • 16. Priority Scheduling Processes Burst time Priority Arrival time P1 10 3 0.0 P2 1 1 1.0 P3 2 4 2.0 P4 1 5 3.0 P5 5 2 4.0 Gantt chart for both preemptive and non-preemptive, also waiting time
  • 17. Priority Scheduling Problem : Starvation – low priority processes may never execute Solution : Aging – as time progresses increase the priority of the process
  • 18. Round-Robin Scheduling The Round-Robin is designed especially for time sharing systems. It is similar FCFS but add preemption concept A small unit of time, called time quantum , is defined
  • 19. Round-Robin Scheduling Each process gets a small unit of CPU time ( time quantum ), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.
  • 21. Round-Robin Scheduling If there are n processes in the ready queue and the time quantum is q , then each process gets 1/ n of the CPU time in chunks of at most q time units at once. No process waits more than ( n -1) q time units.
  • 22. Round-Robin Scheduling Performance q large => FIFO q small => q must be large with respect to context switch, otherwise overhead is too high Typically, higher average turnaround than SJF, but better response
  • 24. Multilevel Queue Ready queue is partitioned into separate queues: foreground (interactive) background (batch) Each queue has its own scheduling algorithm foreground – RR background – FCFS
  • 25. Multilevel Queue example Foreground P1 53 (RR interval:20) P2 17 P3 42 Background P4 30 (FCFS) P5 20
  • 26. Multilevel Queue Scheduling must be done between the queues Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. Time slice – each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR
  • 28. Multilevel Feedback Queue Three queues: Q 0 – RR with time quantum 8 milliseconds Q 1 – RR time quantum 16 milliseconds Q 2 – FCFS Scheduling A new job enters queue Q0 which is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q 1. At Q 1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q 2.
  • 30. Multilevel Feedback Queue P1 40 P2 35 P3 15
  • 31. 5.4 Multiple-Processor Scheduling We concentrate on systems in which the processors are identical (homogeneous) Asymmetric multiprocessing (by one master) is simple because only one processor access the system data structures. Symmetric multiprocessing , each processor is self-scheduling. Each processor may have their own ready queue.
  • 32. Load balancing On symmetric multiprocessing systems, it is important to keep the workload balanced among all processors to fully utilized the benefits of having more than one CPU There are two general approached to load balancing: Push Migration and Pull Migration
  • 33. Symmetric Multithreading An alternative strategy for symmetric multithreading is to provide multiple logical processors (rather than physical) It’s called hyperthreading technology on Intel processors
  • 34. Symmetric Multithreading The idea behind it is to create multiple logical processors on the same physical processor (sounds like two threads) But it is not software provide the feature, but hardware Each logical processor has its own architecture state, each logical processor is responsible for its own interrupt handling.