Open in App
Not now

# Difference between Priority Scheduling and Round Robin (RR) CPU scheduling

• Last Updated : 21 Feb, 2023

1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number of resources required, time needed etc. whereas external priorities are based upon the time in which the work is needed or the amount being paid for the work done or the importance of process. Priority scheduling can be preemptive or non- preemptive.

Note –

• If two processes have the same priority then tie is broken using FCFS.
• The waiting time for the highest priority process is always zero in preemptive mode while it may not be zero in case of non preemptive mode.

Disadvantages: The major problem is the starvation or indefinite blocking. It may so happen that in stream of processes, the system keeps executing the high priority processes and the low priority processes never get executed.

2. Round-Robin (RR) : Round-Robin (RR) Scheduling Algorithm is particularly designed for time sharing systems. The processes are put into the ready queue which is a circular queue in this case. In this case a small unit of time known as time quantum is defined. The algorithm selects the first process from the queue and executes it for the time defined by the time quantum. If the process has burst time less than the time quantum then the CPU executes the next process but if it has burst time higher than the time quantum then the process is interrupted and next process is executed for same time quantum. If a process is interrupted then a context switch happens and the process is put back at the tail of the queue. It is preemptive in nature. This algorithm mainly depends on the time quantum. Very large time quantum makes RR same as the FCFS while a very small time quantum will lead to the overhead as context switch will happen again and again after very small intervals. The major advantage of this algorithm is that all processes get executed one after the other which does not lead to starvation of processes or waiting by process for quite long time to get executed.

Disadvantages : Quantum size: The quantum size must be carefully chosen, a larger quantum size leads to longer waiting times for smaller processes, while a smaller quantum size results in increased overhead.
The difference between Priority Scheduling and Round-Robin (RR) scheduling algorithm are as follows:

My Personal Notes arrow_drop_up
Related Articles