Course contentsShow
← Computer Science
Lesson 1255 of 2,87229. CPU SchedulingFree lesson

Round Robin (RR) Scheduling

Explore time-slice based scheduling where each process gets a fixed quantum, ensuring fairness and responsiveness.

Round Robin (RR) Scheduling

What you'll learn: How Round Robin scheduling ensures every process gets a fair share of CPU time by cycling through them in order.


The Core Idea

Round Robin (RR) is a preemptive scheduling algorithm that gives each process a small, fixed amount of CPU time called a time quantum or time slice (typically 10-100 milliseconds). Processes are kept in a circular queue (like a circle of people waiting their turn). When a process's quantum expires, the CPU preempts it and moves to the next process in the queue. If the process finishes before its quantum runs out, it terminates and leaves the queue.

How It Works

Think of a classroom where the teacher gives each student exactly 5 minutes to present, going around the room in order. When your 5 minutes are up, you sit back down (even if you're not done), and the next student gets their turn. Eventually, you'll get another 5-minute slot.

  1. Process at the front of the ready queue runs for one quantum
  2. Timer interrupt occurs when quantum expires
  3. Context switch moves the process to the back of the queue
  4. Next process gets the CPU
  5. Cycle repeats

Fairness and Responsiveness

RR is excellent for time-sharing systems where multiple users expect quick responses. No process monopolizes the CPU—everyone waits roughly the same amount of time relative to queue position. This makes RR highly responsive, especially for interactive applications.

The Trade-off

Choosing the right quantum is critical. Too small = excessive context switching overhead. Too large = RR behaves like FCFS, losing responsiveness.

Key Takeaway: Round Robin scheduling ensures fairness and good response time by giving each process a fixed, equal time slice in a circular rotation, making it ideal for interactive and time-sharing systems.