Question 59
59. Consider the following three processes with the arrival time and CPU burst time given in milliseconds :
The Gantt Chart for preemptive SJF scheduling algorithm is _________.
Answer : (2) Process | Arrival Time | Burst Time |
P1 | 0 | 7 |
P2 | 1 | 4 |
P3 | 2 | 8 |
The Gantt Chart for preemptive SJF scheduling algorithm is _________.
Question asks for Gantt Chart for preemptive SJF
Option (1) is Not preemptive.
P1 continues execution without being preempted when sorter process P2 with Burst time 4 comes.
Option (2) is Preemptive SJF.
Here, P1 executes for 1 second and then preempted by P2 which executes for 4 seconds. Then P1 finishes its remaining execution followed by execution of P3.
Option (3) is Not preemptive.
Not pre-emptive as P1 continues execution without being preempted when sorter process P2 with Burst time 4 comes. Each of the processes carries on execution without being preempted.
Option (4) is Preemptive but P2 starts execution even before it's arrival time 1.
So, Option (2) is correct answer.