All mock tests are FREE till 31 December — register to save your progress

An OS follows round robin scheduling with a time quantum of 4 ms. Assuming that the CPU is free now and there are 20 processes waiting in the ready queue, what is the maximum amount of time that a process waits before getting into the CPU?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 76 ms

Explanation

In round robin, every process in the ready queue is given at most one time quantum (4 ms) before the scheduler moves to the next process in line. The process that waits longest for its first turn is the one sitting at the very back of the queue, which must let every one of the other 19 processes ahead of it use up to a full 4 ms quantum each before it is finally dispatched. Maximum wait = (20 − 1) × 4 ms = 19 × 4 = 76 ms, option (ii); 80 ms would be the (incorrect) result of counting the process's own quantum as part of its own wait.

More Discrete Structures and Optimization questions