CS FundamentalsHardGATE

Processes (arrival, burst) in ms: P1 (arrival 0, burst 2), P2 (arrival 1, burst 9), P3 (arrival 3, burst 4), P4 (arrival 5, burst 5). They are scheduled by preemptive Shortest Remaining Time First (SRTF); ties go to the process that arrived earlier. What are the average waiting time and the average turnaround time?

  1. A. 3 ms and 7 ms
  2. B. 3 ms and 8 ms
  3. C. 4.75 ms and 9.75 ms
  4. D. 4 ms and 8 ms

Correct answer: B. 3 ms and 8 ms

Simulating SRTF tick by tick gives completion times P1 2, P3 7, P4 12, P2 20; waiting = turnaround − burst, averaging to 3 ms waiting and 8 ms turnaround. Running the same processes strictly in arrival order (FCFS) instead gives 4.75 ms waiting, the result of ignoring preemption.

More Operating Systems questions

Exams that ask this topic