Round Robin Scheduling Algorithm is a CPU scheduling in OS is a preemptive scheduling in which each process gets executed in a cyclic way. It means that particular time slice is allotted to each process which is known as time quantum. This post focus on Round Robin Scheduling Algorithm with example, advantage and disadvantage
CPU is assigned to the process on the basis of FCFS for a fixed amount of time which is called quantum (Cyclic nature).
Once an assigned process is executed for given time period that process is preempted and other ready process executes for given time period.
If the execution of the process gets completed in that time quantum, then the process will get terminate otherwise the process will again go to the ready queue, and the previous process will wait for the turn to complete its execution.
Context switching is used to save states of preempted processes.
This cyclic context switching called as Round Robin scheduling because of each process takes equal time and handover to other and waiting for next round.
It generally used by those operating system which has multiple clients to make use of resources.
Example of Round Robin Scheduling:
Advantage of Round Robin Scheduling:
1] Gives the best performance in terms of average response time.
2] It is best suited for time sharing system
Disadvantage of Round Robin Scheduling:
1] It leads to starvation for processes with larger burst time as they have to
repeat the cycle many times.
2] Its performance heavily depends on time quantum.