Skip to article
ContentsRound Robin
Learn/Chapter 05 of 08

Round Robin Scheduling

Round Robin (RR) shares CPU access through FIFO turns. A selected process runs for at most one quantum. If it finishes earlier, the next process can start immediately. If it is unfinished when the quantum expires, it returns to the queue tail.

The rule

The quantum limits a turn, not the process's total CPU service. A job can need many turns. If no other process is ready, the current process can continue without an actual change of CPU owner.

Worked example: quantum 2

Example inputs
ProcessArrivalBurst
P107
P213
P321
Scroll horizontally for all columns

One CPU · One burst per process · No I/O · Dispatch cost 0 · Quantum 2. Times are abstract units.

At 2, P1 ends its first slice with 5 left. After selection, the CPU runs P2; Ready is P3, P1. Arrivals at this boundary entered before the expired turn returned to the tail.

The full CPU trace is P1 [0, 2), P2 [2, 4), P3 [4, 5), P1 [5, 7), P2 [7, 8), P1 [8, 11). Completion can end a turn before the full 2-unit quantum.

At 10, a quantum expires but the same owner continues because no peer is waiting.

Worked trace Round Robin
FIFO turn · t = 2P2 takes the turn

Admit boundary arrivals before returning the expired owner to the tail.

After selection · t = 2CPU = P2 · Ready = P3, P1

Ready lists the next FIFO turns, after the selected owner has left the queue.

CPU execution: Round RobinP1 runs [0, 2); P2 runs [2, 4); P3 runs [4, 5); P1 runs [5, 7); P2 runs [7, 8); P1 runs [8, 11). Segment widths show elapsed time. Diamond markers show arrivals. ARRIVALSP1P2P3P1P2P3P1P2P10245781110Quantum boundaries. Same owner continues at 10.
Scroll horizontally for all intervals
Complete CPU trace · [start, end)
  1. P1: [0, 2)
  2. P2: [2, 4)
  3. P3: [4, 5)
  4. P1: [5, 7)
  5. P2: [7, 8)
  6. P1: [8, 11)

Quantum expiry keeps the same owner at 10. Completion can end a turn early.

RR rotates access while retaining unfinished work. A completion can end a turn early; a quantum boundary does not always change the process.
Open this example in the simulator

Calculate the result

Per-process results
ProcessCompletionWaitingTurnaroundResponse
P1114110
P28471
P35232
Scroll horizontally for all columns

P2: turnaround = 8 − 1 = 7. Waiting = 7 − 3 = 4. First response = 2 − 1 = 1.

Waiting and first response coincide for a nonpreempted process; interrupted work can wait again after its first turn.

Mean waiting = (4 + 4 + 2) / 3 ≈ 3.333 units. Mean response = 1 units.

Choosing a quantum

A shorter quantum creates more opportunities to take a turn, but can also produce more process changes and dispatch overhead. A sufficiently long quantum makes RR behave like FCFS for a finite workload whose bursts all finish within one turn.

For this input, RR changes processes 5 times, compared with 2 for FCFS. Both finish at 11 because dispatch cost is zero. Counting only quantum expirations would miss changes caused by completion.