An OS follows round-robin scheduling with time quantum of 4 ms. Assuming that…
2022
An OS follows round-robin scheduling with time quantum of 4 ms. Assuming that the CPU is free now and there are 20 processes waiting in the ready queue, the maximum amount of time that a process waits before getting into the CPU is
- A.
80 ms
- B.
76 ms
- C.
84 ms
- D.
None of the above
Attempted by 332 students.
Show answer & explanation
Correct answer: B
Answer: 76 ms
Reasoning:
Interpretation: The ready queue has 20 processes including the process we're considering (the common interpretation).
Worst-case position: the process is at the end of the queue, so there are 19 processes ahead of it.
Each process ahead can use up to the full time quantum of 4 ms before the CPU reaches our process once: wait time = 19 × 4 ms = 76 ms.
Alternate interpretation: if the 20 processes were all ahead of the considered process (i.e., 20 other processes), the wait would be 20 × 4 ms = 80 ms. The question’s expected answer uses the inclusive interpretation leading to 76 ms.
A video solution is available for this question — log in and enroll to watch it.