Round Robin Scheduling
Round robin scheduling is a preemptive CPU scheduling algorithm that gives every ready process a fixed time slice, called a time quantum, in rotation. When a process's quantum expires before it finishes, it is preempted and moved to the back of the queue so the next process runs, which guarantees fairness and good responsiveness.
Round Robin is a preemptive scheduling algorithm designed specifically for fairness and interactive responsiveness. Every process in the ready queue gets a fixed amount of CPU time, called a time quantum or time slice, and then, whether it's finished or not, it's preempted and moved to the back of the queue, giving the next process its turn.
How it works
Processes sit in a circular queue. The scheduler always runs whichever process is at the front for exactly one time quantum. If the process finishes within that quantum, it's done and removed from the queue. If it hasn't finished, it's preempted and placed at the back of the queue, and the next process in line gets its turn.
A worked example
Three processes, all arriving at time 0, with a time quantum of 4:
| Process | Burst Time |
|---|---|
| P1 | 10 |
| P2 | 5 |
| P3 | 8 |
Queue order: P1, P2, P3.
- P1 runs 0-4 (quantum expires, 6 remaining), moves to back of queue.
- P2 runs 4-8 (quantum expires, 1 remaining), moves to back.
- P3 runs 8-12 (quantum expires, 4 remaining), moves to back.
- P1 runs 12-16 (quantum expires, 2 remaining), moves to back.
- P2 runs 16-17 (only needed 1 more, finishes here).
- P3 runs 17-21 (only needed 4 more, finishes here).
- P1 runs 21-23 (only needed 2 more, finishes here).
Completion times: P2 at 17, P3 at 21, P1 at 23. Notice every process got CPU time relatively early and repeatedly, rather than one process monopolizing the CPU for a long uninterrupted stretch, exactly the fairness property Round Robin is designed for.
Choosing the time quantum: a genuine tradeoff
Too large a time quantum, and Round Robin starts behaving like FCFS (a process mostly finishes within one long slice anyway, so little actual rotation happens). Too small a time quantum, and dispatch overhead (covered in the scheduler vs dispatcher topic) starts eating a large share of total CPU time, since context switches happen extremely frequently relative to how much real work gets done in each slice. A common rule of thumb aims for a quantum where roughly 80% of processes finish within one slice, small enough to feel responsive, large enough that switching overhead stays reasonable.
Where this matters in real systems
Round Robin's core idea, time-sliced, rotating, guaranteed-fair CPU access, underlies time-sharing systems broadly and is a real component inside more sophisticated real production schedulers like Linux's CFS, which blends fairness-driven time-slicing with priority awareness rather than using textbook Round Robin in its purest form.
What interviewers actually ask about Round Robin
- "What is Round Robin scheduling?" Every process gets a fixed time quantum in rotation; if it doesn't finish within that quantum, it's preempted and moved to the back of the queue.
- "What happens if the time quantum is too large or too small?" Too large and it degenerates toward FCFS-like behavior; too small and dispatch/context-switch overhead consumes a large share of total CPU time.
- "Is Round Robin preemptive or non-preemptive?" Preemptive, a process can be interrupted mid-execution once its time quantum expires.
- "Why is Round Robin considered good for interactive systems specifically?" Because every process gets guaranteed, regular CPU access rather than potentially waiting a long time behind one long process, giving good response time even under heavy load.
Key takeaways
- Round Robin gives every process a fixed time quantum in rotation, preempting whoever's running once the quantum expires.
- Choosing the time quantum is a real tradeoff between responsiveness (smaller) and dispatch overhead (larger).
- It guarantees fairness and strong interactive response time compared to algorithms that let one process run uninterrupted for a long stretch.
- Its rotating, time-sliced idea underlies real production schedulers, including as one influence inside Linux's CFS.
More in Process Scheduling
Browse all Operating Systems topics
Log in to save which topics you've read across every subject.
Frequently asked questions
What is Round Robin scheduling?
Every process gets a fixed time quantum in rotation; if it doesn't finish within that quantum, it's preempted and moved to the back of the queue.
What happens if the time quantum is too large or too small?
Too large and it degenerates toward FCFS-like behavior; too small and dispatch/context-switch overhead consumes a large share of total CPU time.
Is Round Robin preemptive or non-preemptive?
Preemptive, a process can be interrupted mid-execution once its time quantum expires.
Why is Round Robin considered good for interactive systems specifically?
Because every process gets guaranteed, regular CPU access rather than potentially waiting a long time behind one long process, giving good response time even under heavy load.