Week 5b
Week 5b
•q=2
•Average Turn Around time = (13 + (12-1) + (5-2) +(9-3) + (14-4)) / 5 = 43 / 5 =
8.6 unit
•Average waiting time = ((13-5) + (11-3) + (3-1) + (6-2) + (10-3)) / 5 = 29 / 5 = 5.8
unit
Priority Scheduling
A priority number (integer) is associated with each process
The CPU is allocated to the process with the highest priority
(usually, smallest integer highest priority)
Two schemes:
• Preemptive
• Nonpreemptive
Problem Starvation – low priority processes may never
execute
Solution Aging – as time progresses increase the priority of the
process
Note: SJF is priority scheduling where priority is the inverse of
predicted next CPU burst time
Summary
FIFO:
+ simple
- short jobs can get stuck behind long ones; poor I/O
RR: