Professional Documents
Culture Documents
SCHEDULINGALGORITHMS
SCHEDULINGALGORITHMS
Consider the following five processes each having its own unique burst time and
arrival time.
P1 6 2
P2 2 5
P3 8 1
P4 3 0
P5 4 4
Preemptive SJF
Consider the following five process:
P1 6 2
P2 2 5
P3 8 1
P4 3 0
P5 4 4
Process ID Arrival Time Burst Time
1 2 3
2 0 4
3 4 2
4 5 4
P0 0-0=0
P1 5-1=4
P2 8-2=6
P3 16 - 3 = 13
P0 0 5 0
P1 1 3 5
P2 2 8 14
P3 3 6 8
Waiting time of each process is as follows −
P0 0-0=0
P1 5-1=4
P2 14 - 2 = 12
P3 8-3=5
P0 0 5 1 0
P1 1 3 2 11
P2 2 8 1 14
P3 3 6 3 5
P0 0-0=0
P1 11 - 1 = 10
P2 14 - 2 = 12
P3 5-3=2