For the following processes Show the scheduling sequence and
For the following processes: Show the scheduling sequence and average waiting time with a preemptive Shortest-Job-First scheduling algorithm. Show the scheduling sequence and average waiting time with a non-preemptive Shortest-Job-First scheduling algorithm.
Solution
1. Pre-emptive Shortest Job First
0.0-----------------2.0------------------6.0-----------------8.0-----------------------12.0---------------17.0
Average waiting time = ((12-0)+(4-2)+(6-4)+(8-5))/4 = (12+2+2+3)/4 = 4.75
2. Non Preemptive scheduling
0----------------------7.0-------------------------9.0-----------------------13.0----------------------17.0
Average waiting time = ((0-0)+(7-2)+(8-4)+(12-5))/4 = (0+5+4+7)/4 = 16/4 = 4
| P1 | P2 | P3 | P4 | P5 |
