Since it's non-preemptive, the priorities are not important for the calculation.
IO |
Arrival |
CPU time (in Msec) |
Priority(Not Used) |
Completion Time |
TAT(CT-AT) |
WT=TAT-BT |
P1 |
0 |
10 |
5 |
22 |
22 |
12 |
P2 |
0 |
7 |
2 |
7 |
7 |
0 |
P3 |
4 |
5 |
1 |
12 |
8 |
3 |
P4 |
10 |
15 |
4 |
40 |
30 |
15 |
P5 |
20 |
3 |
3 |
25 |
5 |
2 |
Avg WT = (32/5) = 6.4ms
Gantt Chart
Process No |
P2 |
P3 |
P1 |
P5 |
P4 |
CPU Time |
0-7 |
7-12 |
12-22 |
22-25 |
25-40 |