04 CPU Scheduling
04 CPU Scheduling
04 CPU Scheduling
P1 P2 P3
0 24 27 30
P2 P3 P1
0 3 6 30
P4 P1 P3 P2
0 3 9 16 24
• SJF is priority scheduling where priority is the inverse of predicted next CPU
burst time
• Problem Starvation – low priority processes may never execute
• Solution Aging – as time progresses increase the priority of the process
Example of Priority Scheduling
ProcessA arri Burst TimeT Priority
P1 10 3
P2 1 1
P3 2 4
P4 1 5
P5 5 2
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30