CS FundamentalsHardGATE CS

Processes (arrival, burst): P1 (0, 8), P2 (1, 5), P3 (2, 2), P4 (4, 1), P5 (6, 4), scheduled by SRTF. How many times is a running process preempted (taken off the CPU before it finishes)?

  1. A. 2
  2. B. 3
  3. C. 1
  4. D. 7

Correct answer: A. 2

Gantt chart: P1 0-1 | P2 1-2 | P3 2-4 | P4 4-5 | P2 5-9 | P5 9-13 | P1 13-20. A preemption happens at each boundary where the outgoing process still has work left: count those, ignoring boundaries where a process simply completed.

More Operating Systems questions

Exams that ask this topic