In: Computer Science
Operating system
******Preemptive SJF************
The newly arrived process with shorter CPU burst will preempt the currently executing process.
Draw the Gantt Chart and calculate the average waiting time.
Process |
Arrival Time |
Burst Time |
Turn Around Time |
Waiting Time |
P4 |
0 |
5 |
||
P3 |
1 |
9 |
||
P2 |
2 |
4 |
||
P1 |
3 |
8 |
Average waiting time=(P4 + P3 + P2 +P1) / 4
=(0+16+3+6) / 4
= 25/4
= 6.25