process |
burst time |
arrival time |
priority |
P1 |
9 |
0 |
5 |
P2 |
3 |
1 |
1 |
P3 |
5 |
6 |
4 |
P4 |
1 |
4 |
3 |
P5 |
4 |
3 |
2 |
1.FCFS
0 9 12 17 18 22
The waiting time is (0+9+12+17+18)/5=11.2ms
- SJF
Preemptive(shortest-job-first scheduling):
0 1 4 8 13 22
The waiting time is (0+1+4+8+13)/5=5.2ms
Preemptive(shortest-remaining-time-first scheduling):
0 1 4 8 9 14 22
The waiting time is [0+0+(4-3)+(8-4)+(9-6)+(14-1)]/5=4.2ms
3.priority scheduling
0 3 7 8 13 22
The waiting time is (0+3+7+8+13)/5=5.2ms
4.Round-Robin
P1 |
P2 |
P3 |
P4 |
P5 |
P3 |
P5 |
P1 |
P1 |
0 3 6 9 10 13 15 16 19 22
The waiting time is (0+3+6+9+10+13+15+16+19)/5=18.2ms