Round Robin Scheduling Program in Java
Round Robin (RR) algorithm is a CPU scheduling algorithm. It is also used in network schedulers. It is especially designed for time sharing system. It is also known as time slicing scheduling algorithm. It is closely similar to FCFS scheduling. In this section, we will discuss the round robin scheduling algorithm and its implementation in a Java program.
Round Robin Algorithm
Round Robin scheduling is the preemptive process scheduling algorithm. Each process is provided a fix time to execute in cyclic way. The fixed time is called the time quantum or time slot or time stamp or time slice. Once a process is executed for a given time period, it is preempted and other process executes for a given time period. Context switching is used to save states of preempted processes. The objective of the algorithm is to maximize the CPU utilization. The algorithm is best suited for time sharing system.
There are the following three variants of Round Robin algorithm:
Before moving to the example, first we will understand the various time related to a process used in Round Robin algorithm.
Advantage of Round Robin Scheduling
Round Robin Scheduling Java Program