A uniprocessor computer system has only two processes, both of which alternate…
2003
A uniprocessor computer system has only two processes, both of which alternate between 10 ms CPU bursts and 90 ms I/O bursts. Both processes were created at nearly the same time. The I/O operations of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization over a long period of time for this system?
Answer: D. Round robin scheduling with a time quantum of 5 ms — Concept: CPU utilization over a repeating schedule is the CPU-busy time divided by the total elapsed time. When I/O can overlap, a scheduler can change when…
- A.
First come first served scheduling
- B.
Shortest remaining time first scheduling
- C.
Static priority scheduling with different priorities for the two processes
- D.
Round robin scheduling with a time quantum of 5 ms
Attempted by 260 students.
Show answer & explanation
Correct answer: D
Concept: CPU utilization over a repeating schedule is the CPU-busy time divided by the total elapsed time. When I/O can overlap, a scheduler can change when each process finishes its CPU burst and starts its 90 ms I/O, thereby changing the length of the repeating schedule even when context-switch cost is ignored.
Application: Trace the two processes, P1 and P2, from the moment both are ready.
For first-come first-served, shortest-remaining-time-first, and static priority scheduling, one process completes its 10 ms CPU burst at 10 ms and the other completes at 20 ms. Their I/O therefore ends at 100 ms and 110 ms.
That pattern repeats every 100 ms: the CPU performs 20 ms of process work in each 100 ms interval. Thus the utilization for each of those three strategies is 20/100 = 20%.
For round robin with a 5 ms quantum, the initial execution order is P1 from 0–5 ms, P2 from 5–10 ms, P1 from 10–15 ms, and P2 from 15–20 ms.
P1 and P2 now begin I/O at 15 ms and 20 ms, so they become ready again at 105 ms and 110 ms. The next 20 ms CPU block starts at 105 ms, giving a repeating span of 105 ms.
Round robin therefore uses the CPU for 20 ms in 105 ms, so its utilization is 20/105 ≈ 19.05%.
Cross-check / contrast: The first three strategies produce completion times 10 ms apart, whereas 5 ms round-robin slicing makes the completion times only 5 ms apart. The resulting I/O intervals overlap more, extending the CPU-idle gap from 80 ms to 85 ms.
Round robin scheduling with a time quantum of 5 ms gives the least CPU utilization. The conclusion follows from the shifted I/O start times; no context-switch-overhead assumption is needed.
A video solution is available for this question — log in and enroll to watch it.