Round robin allocates a section of time for each inbound process. When a process is placed on the ready queue it will eventually be assigned a time quantum in order to execute. Processes in the ready queue will be executed in a first come first served basis.

Process

Average Burst time

P1

6

P2

8

P3

2

The choice of time quantum is important. If it is too short then the overhead of process swapping may be unacceptable. If it is too large round robin degenerates to first come first served. That is, if the time quantum is greater than the longest running process then no process will be interrupted thus we get FCFS.

Consider a time quantum of 4 seconds (t = 4)

The above diagram shows the order the processes will be run in order to fulfil their requirements. Round robin provides good response time compared to FCFS (first come first served). Response time is the time a process must wait in order to get some processor time. Maximum response time is simply the largest response time each process must wait for.

 

Round robin - R t = n t r

FCFS - R t =

 

Where R t is the maximum response time

n is the number of processes.

t r is the time quantum for round robin

P i is the i’th process

T(x) is the time function of a process (i.e. it gets the execution time of a process).

 

This may look a bit complicated, but it helps us see why round robin is provides better response time. This is important in an interactive system as when a user clicks on something, they expect something to happen. If it takes too long then the user will become frustrated and their efficiency will drop. Most people have had to wait for their computer to catch up with them!

Let's plug in some numbers for our example.

Round robin - R t = n t r

R t = 3 x 4

R t = 12 seconds

FCFS - R t =

R t =

R t = 16 seconds