Round Robin Scheduling
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time slot in a cyclic way.
It is similar to FCFS scheduling but preemption is added, allowing the system to switch between processes.
Characteristics of Round Robin Scheduling:
- Round Robin or RR algorithm is one of the oldest and easiest algorithms.
- It is mostly used in traditional operating systems.
- It is clock-driven.
- RR algorithm is a real-time algorithm.
- RR method comes under the category of preemptive algorithms.
Advantages of Round Robin Scheduling Algorithm:
The advantages of the RR scheduling algorithm is as follows:
- It helps all jobs get a fair allocation of the CPU.
- Each process can be rescheduled after a particular time slot.
- In RR scheduling ready processes are added to the end of the queue.
- It is cyclic.
- RR scheduling algorithm gives the best performance in average response time.
Disadvantages of Round Robin Scheduling Algorithm:
The disadvantages of the RR scheduling algorithm is as follows:
- RR scheduling algorithm gives context switches more time.
- It is a time-consuming scheduling algorithm for smaller quantum.
- It has a low throughput.
- When the time quantum for scheduling is less, the Gantt chart seems too big.
- This algorithm offers a larger waiting time.
Example of RR scheduling algorithm:
Process | Duration | Order | Arrival time |
P1 | 3 | 1 | 0 |
P2 | 4 | 2 | 0 |
P3 | 5 | 3 | 0 |
Let time quantum be 1 unit.
P1 | P2 | P3 | P1 | P2 | P3 | P1 | P2 | P3 | P2 |
0 10
Therefore, Waiting time of:
P1=4
P2=6
P3=6
Average waiting time= (4+6+6)/3 = 5.33
Reference:
Round Robin Schedule of Operating System.