CS FundamentalsModerateGATE CS (PYQ pattern)

Round Robin uses a 20 ms quantum and every context switch costs 2 ms; all n processes are CPU-bound and always use the full quantum. From the moment a process is preempted until it starts running again, the CPU performs one switch, then for each of the other n - 1 processes a quantum followed by a switch. If this gap must not exceed 200 ms, what is the largest n?

  1. A. 11
  2. B. 10
  3. C. 9
  4. D. 8

Correct answer: B. 10

Gap = n switches + (n - 1) quanta = 2n + 20(n - 1) = 22n - 20 <= 200, so n <= 10. Ignoring switches gives 20(n - 1) <= 200, n = 11; charging n full quanta plus switches gives 22n <= 200, n = 9.

More Operating Systems questions

Exams that ask this topic