Q41.Marks: +2.0UGC NET Paper 2: Computer Science17th June 2023
Consider the following table of arrival time and burst time for three processes P0, P1, P2:
Process
arrival time
Burst time
P0
0 ms
7
P1
1 ms
3
P2
2 ms
7
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of a process. What is the average waiting time for the three processes?
1.3 ms
2.3.67 ms✓ Correct
3.4.47 ms
4.4 ms
Solution
The correct answer is 3.67 ms
Key PointsIn Shortest Job First (SJF) scheduling, the process with the smallest burst time is processed next. In Preemptive SJF, if a new process arrives with CPU burst length less than remaining time of current executing process, CPU is preempted, and that new process starts execution.