
- Operating System Tutorial
- OS - Home
- OS - Needs
- OS - Overview
- OS - History
- OS - Components
- OS - Structure
- OS - Architecture
- OS - Services
- OS - Properties
- OS - TAT & WAT
- OS Processes
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling Algorithms
- FCFS Scheduling Algorithm
- SJF Scheduling Algorithm
- Round Robin Scheduling Algorithms
- HRRN Scheduling Algorithms
- Priority Scheduling Algorithms
- Multilevel Queue Scheduling
- Context Switching
- Operations on Processes
- Lottery Process Scheduling
- Predicting Burst Time SJF Scheduling
- Race Condition Vulnerability
- Critical Section Synchronization
- Mutual Exclusion Synchronization
- Process Control Block
- Inter Process Communication
- Preemptive and Non-Preemptive Scheduling
- Operating System - Deadlock
- Introduction to Deadlock in Operating System
- Conditions for Deadlock in Operating System
- OS Synchronization
- Operating System - Process Synchronization
- Operating System - Critical Section
- Operating System - Semaphores
- Operating System - Counting Semaphores
- Operating System - Mutex
- Operating System - Lock Variable in Process Synchronization
- Operating System - Turn Variable in Process Synchronization
- Operating System - Bounded Buffer Problem
- Operating System - Reader Writer Locks in Process Synchronization
- Operating System - Test Set Lock in Process Synchronization
- Operating System - Peterson Solution in Process Synchronization
- Operating System - Monitors in Process Synchronization
- Operating System - Sleep and Wake in Process Synchronization
- OS Memory Management
- OS - Memory Management
- OS - Virtual Memory
- OS Storage Management
- File Systems in Operating System
- Linked Index Allocation in Operating System
- Indexed Allocation in Operating System
- Structures of Directory in Operating System
- File Attributes in Operating System
- Operating System - Page Replacement
- Operating Systems - Thrashing
- Belady’s Anomaly in Page Replacement Algorithms
- Optimal Page Replacement Algorithm
- Operating System - Types
- Types of Operating System
- Batch Processing Operating System
- Multiprocessing Operating System
- Hybrid Operating System
- Monolithic Operating System
- Zephyr Operating System
- Nix Operating System
- Blackberry Operating System
- Garuda Operating System
- Tails Operating System
- Clustered Operating System
- Haiku Operating System
- AIX Operating System
- Solus Operating system
- Tizen Operating System
- Bharat Operating System
- Fire Operating System
- Bliss Operating System
- VxWorks Operating System
- Embedded Operating System
- Single User Operating System
- OS Miscellaneous
- OS - Multi-threading
- OS - I/O Hardware
- OS - I/O Software
- OS - Security
- OS - Linux
- Exams Questions Answers
- Exams Questions Answers
- OS Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
Round Robin (RR) Scheduling Algorithm
Among the CPU scheduling strategies, Round Robin Scheduling is one of the most efficient and the most widely used scheduling algorithm which finds its employability not only in process scheduling in operating systems but also in network scheduling.
Round Robin (RR) Scheduling
This scheduling strategy derives its name from an age old round-robin principle which advocated that all participants are entitled to equal share of assets or opportunities in a turn wise manner. In RR scheduling, each process gets equal time slices (or time quanta) for which it executes in the CPU in turn wise manner. When a process gets its turn, it executes for the assigned time slice and then relinquishes the CPU for the next process in queue. If the process has burst time left, then it is sent to the end of the queue. Processes enter the queue on first come first serve basis.
Round Robin scheduling is preemptive, which means that a running process can be interrupted by another process and sent to the ready queue even when it has not completed its entire execution in CPU. It is a preemptive version of First Come First Serve (FCFS) scheduling algorithm.
Features of Round Robin Scheduling
- RR is a fair scheduling strategy where all processes get equal share to execute in turn wise manner.
- It is a preemptive scheduling method where an executing process must give up its control of the CPU once its time quantum expires.
- Through RR scheduling strategy, none of the processes go into starvation.
- It is widely used for its simple working principle.
- The performance of RR scheduling is vastly dependent on the chosen time quantum.
Working Principle of Round Robin Scheduling
- Any new process that arrives the system is inserted at the end of the ready queue in FCFS manner.
- The first process in the queue is removed and assigned to the CPU.
- If the required burst time is less than or equal to the time quantum, the process runs to completion. The scheduler is invoked when the process completes executing to let in the next process in the ready queue to the CPU.
- If the required burst time is more than the time quantum, the process executes up to the allotted time quantum. Then its PCB (process control block) status is updated and it is added to the end of the queue. Context switch occurs and the next process in the ready queue is assigned to the CPU.
- The above steps are repeated until there are no more processes in the ready queue.
We can understand the workings RR scheduling algorithm through the aid of the following example.
Example of Round Robin Scheduling
Let us consider a system that has four processes which have arrived at the same time in the order P1, P2, P3 and P4. The burst time in milliseconds of each process is given by the following table −
Process | CPU Burst Times in ms |
---|---|
P1 | 8 |
P2 | 10 |
P3 | 6 |
P4 | 4 |
Let us consider time quantum of 2ms and perform RR scheduling on this. We will draw GANTT chart and find the average turnaround time and average waiting time.
GANTT Chart with time quantum of 2ms

Average Turnaround Time
Average TAT = Sum of Turnaround Time of each Process / Number of Processes
=(TATP1+TATP2+TATP3+TATP4)/4
= ( 24 + 28 + 22+ 16) / 4 = 22.5 ms
In order to calculate the waiting time of each process, we multiply the time quantum with the number of time slices the process was waiting in the ready queue.
Average Waiting Time
Average WT = Sum of Waiting Time of Each Process / Number of processes
=(WTP1+WTP2+WTP3+WTP4)/4
= ( 8*2 + 9*2+ 8*2+ 6*2) / 4 = 15.5 ms
Advantages of Round Robin Scheduling
- Round Robin scheduling is the most a fair scheduling algorithm whereby all processes are given equal time quantum for execution.
- Starvation of any process caused by indefinite waiting in ready queue is totally eliminated in RR scheduling.
- It does not require any complicated method to calculate the CPU burst time of each process prior to scheduling.
- It is pretty simple to implement and so finds application in a wide range of situations.
- Convoy effect does not occur in RR scheduling as in First Come First Serve CPU (FCFS) scheduling.
Disadvantages of Round Robin Scheduling
- The performance of Round Robin scheduling is highly dependent upon the chosen time quantum. This requires prudent analysis before implementation, failing which required results are not received.
- If the chosen time quantum is very large, most of the processes with complete within the burst time. In effect, RR scheduling will act as FCFS scheduling. Thus, all the limitations of FCFS will come into the system.
- If the chosen time quantum is too small, the CPU will be very busy in context switching, i.e. swapping in swapping out processes to and from the CPU and memory. This would reduce the throughput of the system since more time will be expended in context switching rather than actual execution of the processes.
- RR scheduling does not give any scope to assign priorities to processes. So, system processes which need high priority gets the same preference as background processes. This may often hamper the overall performance of a system.
Conclusion
Round Robin scheduling, if properly implemented, provide the simplest and the best solutions to scheduling problems. A number of variations of RR scheduling are being researched upon and implemented, in order to avoid the disadvantages of this algorithm. One variant that helps to provide near perfect time quantum is Dynamic Time Quantum Scheduling. Here, the time quantum dynamically varies according to the behaviour of the processes in the system. Another variant, the Selfish Round Robin scheduling assigns priorities to processes and provides more CPU slices to higher priority processes.