Skip to content
We areTOP 1%

How does Round Robin scheduling work, and how does the time quantum affect it?

MediumConceptCPU Scheduling
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Round Robin (RR) gives each ready process a fixed slice of CPU time called the time quantum, typically 10–100 ms. If a process has not finished when its quantum expires, it is preempted and moved to the back of the ready queue.

  • It is designed for time-sharing: with n processes, each waits at most (n − 1) × q before its next turn, so response time is good and no process starves.
  • If the quantum is too large, RR behaves like FCFS. If it is too small, much of the CPU time goes to context switches. A common rule of thumb is that about 80% of CPU bursts should be shorter than the quantum.
  • Average waiting time is usually higher than with SJF; RR trades that for responsiveness.

Example: q = 2, and P1, P2 and P3 arrive at time 0 with bursts of 5, 3 and 1.

Gantt chart: P1 0–2 | P2 2–4 | P3 4–5 | P1 5–7 | P2 7–8 | P1 8–9

ProcessBurstCompletion = TATWT = TAT − Burst
P1594
P2385
P3154

Average WT = 13 / 3 ≈ 4.33. Response times are 0, 2 and 4, so every process starts within 4 time units.

More in CPU Scheduling

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account