design your example and give computation results of several cpu schedulers
1、First-Come,First-Served Scheduling
Process Burst Time
P1 7
P2 3
P3 2
P4 5
P5 8
0 7 10 12 17 25
Average waiting time = (0+7+10+12+17)/5=9.2 milliseconds
2、Shortest-Job-First Scheduling
Process Burst Time
P1 7
P2 3
P3 2
P4 5
P5 8
0 2 5 10 17 25
Average waiting time = (10+2+0+5+17)/5=6.8 milliseconds
3、Shortest-Remaining-Time-First Scheduling
Process Burst Time Arrival Time
P1 7 0
P2 3 1
P3 2 3
P4 5 6
P5 8 2
0 1 4 6 11 17 25
Average waiting time = (10+0+1+0+15)/5 = 5.2 milliseconds
4、Priority Scheduling
Process Burst Time Priority
P1 7 2
P2 3 1
P3 2 3
P4 5 3
P5 8 4
0 3 10 12 17 25
Average waiting time = (3+0+10+12+17)/5 = 8.4 milliseconds
5、Round-Robin Scheduling
Process Burst Time
P1 7
P2 3
P3 2
P4 5
P5 8
Use a time quantum of 2 milliseconds
P1 |
P2 |
P3 |
P4 |
P5 |
P1 |
P2 |
P4 |
P5 |
P1 |
P4 |
P5 |
P1 |
P5 |
0 2 4 6 8 10 12 13 15 17 19 20 22 23 25
Average waiting time = (16+10+4+15+17)/5 = 12.4 milliseconds