Unit 1 CH 2
Unit 1 CH 2
P2 P3 P1
0 3 6 30
• Associate with each process the length of its next CPU burst
• Use these lengths to schedule the process with the shortest time
• SJF is optimal – gives minimum average waiting time for a
given set of processes
• The difficulty is knowing the length of the next CPU request
• Could ask the user
P4 P1 P3 P2
0 3 9 16 24
• Commonly, α set to ½
• Preemptive version called shortest-remaining-time-first
P1 P2 P4 P1 P3
0 1 5 10 17 26
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
• 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 Q1
• At Q1 job is again served FCFS and receives 16
additional milliseconds
• If it still does not complete, it is
preempted and moved to queue Q2
• Linux scheduling
• Windows scheduling
• Solaris scheduling
RR is 23ms: