SW StudyWalks

Computer Science  /  CS 0309  ·  Procedure · 60–90 seconds

Round-Robin, Run to the Clock

Video not yet published
to the StudyWalks catalog
State

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.

Show

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.

Watch for

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.

Builds on

Unlocks

  • Nothing yet depends on this.