UGC-NET | UGC NET CS 2018 July – II | Question 59
Consider the following three processes with the arrival time and CPU burst time given in milliseconds:
Process Arrival Time Burst Time P1 0 7 P2 1 4 P3 2 8
The Gantt Chart for preemptive SJF scheduling algorithm is _________.
Explanation: P1 arrive at 0 it will be served by CPU for 1 unit. After 1 unit P2 arrived ans it is shortest So it will execute for 4 unit, after its execution There are 2 processes out of which P1 is shortest so it will execute for 6 unit after its execution P1 will execute for 8 unit.
Gantt chart for preemptive SJF scheduling algorithm is:
So, option (B) is correct.
Quiz of this Question