OS Scheduler

Round Robin (Scheduling)

Scheduling on user-facing OS (windows, mac, linux) is implemented through round robin (actually a MFQ).

Uses Preemption based on a Clock.

Clock interrupt is generated at periodic intervals. When an interrupt occurs, the currently running process is placed in the ready queue. Next ready job is selected (essentially Time Slicing).

Time Quantum

The time quantum is the length of the time slice used by the round robin scheduler.

One way of viewing Round Robin is as a compromise between FCFS and SJF. At one extreme, if the time quantum is infinite (or at least, longer than the longest task), Round Robin behaves exactly the same as FCFS.

“Round Robin can also be quite poor when running a mixture of I/O-bound and compute-bound tasks”

Why?

An I/O-bound process uses a processor for a short period, then is blocked for I/O; it waits for the I/O operation to complete then joins the ready queue. On the other hand, a processor-bound process generally uses a complete time quantum while executing and immediately returns to the ready queue. Thus, processor-bound processes tend to receive an unfair portion of processor time, which results in poor performance for I/O-bound processes, inefficient use of I/O devices, and an increase in the variance of response time

  • Ahh, this is why I saw ZED frame rate issues when loading the CPU!

Advantages of RR

  • Good overall strategy
  • Processor-bound processes receive an unfair share