CS FundamentalsVery hardGATE CS

Processes (arrival, burst): P1 (0, 2), P2 (1, 9), P3 (2, 1), P4 (3, 1), P5 (4, 1). Rank FCFS, non-preemptive SJF, SRTF and RR (q = 1) by average waiting time, lowest first.

  1. A. SRTF < SJF < RR q=1 < FCFS
  2. B. SJF = SRTF < FCFS < RR q=1
  3. C. SJF = SRTF < RR q=1 < FCFS
  4. D. RR q=1 < SRTF < SJF < FCFS

Correct answer: C. SJF = SRTF < RR q=1 < FCFS

Averages: FCFS 5.6, SJF 0.8, SRTF 0.8, RR q=1 2. Under SJF, P2 never gets the CPU before the 1-unit jobs that arrive while P1 runs, so SRTF has nothing to preempt and ties with SJF; FCFS lets P2 block all three short jobs.

More Operating Systems questions

Exams that ask this topic