RR is a preemptive scheduler, which is designed especially for time-sharing systems. In other words, it does not wait for a process to finish or give up control. In RR, each process is given a time slot to run. If the process does not finish, it will “get back in line” and receive another time slot until it has completed. RR can be implemented using a FIFO queue where new jobs are inserted at the tail end.
fifo_queue fQ // FIFO queue add_task (proc) { // method to add a task reschedule(why) { // method to remove the next process and run it
RR assigns a time quanta (i.e. time slot) to each process waiting to be run. For the jobs A, B, C and D in the previous example, RR’s Gantt chart would be: If time quanta = 3
The performance of RR depends on the size of the time quantum, and if the time quantum is large, RR will behave just like the FCFS policy. In general, the time quantum to be large with respect to the context-switch time(cs should be around 10% of time quantum) |