CS FundamentalsVery hardProduct company interview · GATE level

Round Robin is used with a quantum of 4 ms and a context-switch time of 1 ms. There are always 10 CPU-bound processes ready and none does I/O. What fraction of CPU time does useful work, and how long does a process wait between the end of one of its quanta and the start of its next?

  1. A. 80%; 46 ms
  2. B. 80%; 36 ms
  3. C. 75%; 46 ms
  4. D. 80%; 45 ms

Correct answer: A. 80%; 46 ms

Every 4 ms quantum is followed by a 1 ms switch, so useful work is 4/(4 + 1) = 80%. After a process's quantum ends, each of the other 9 processes needs a switch in plus its 4 ms quantum, and then one more switch brings the CPU back: 10 x 1 + 9 x 4 = 46 ms. 36 ms ignores the switches, 45 ms forgets the final switch back, and 75% divides the switch time by the quantum alone. Raising efficiency to 90% would need a 9 ms quantum and a gap of 91 ms - the usual trade-off between overhead and response time.

More Operating Systems questions

Exams that ask this topic