Computer Science / CS 0309 · Procedure · 60–90 seconds
Round-Robin, Run to the Clock
to the StudyWalks catalog
A round-robin schedule grants each process one time slice in rotation — a finished process releases the CPU early, an unfinished one rejoins the back of the queue — and a full trace shows exactly when everyone completes.
Three processes arrive needing 3, 4, and 2 milliseconds of work, with a 2-millisecond slice. The rotation begins. First slice: process one runs 2 of its 3 — one remains — and goes to the back. Second slice: process two runs 2 of its 4 — two remain. Third slice: process three runs its full 2 and finishes at millisecond 6, releasing the CPU on time. Fourth turn: process one needs only 1 — it finishes at millisecond 7 and releases the slice early. Fifth turn: process two runs its last 2 and finishes at millisecond 9. Nine milliseconds of work, nine milliseconds of clock, three finishing times the trace predicted to the tick: 6, 7, 9. Every process waited, none starved, and the strategy's fairness is visible in the arithmetic.
A trace at classroom scale is the honest way to see a policy — the same rotation runs beneath every busy machine, thousands of turns per second.
Unlocks
- Nothing yet depends on this.