Non Preemptive Priority Scheduling Algorithm
For Complete YouTube Video: Click Here
In this class, we will try to understand Non Preemptive Priority Scheduling Algorithm.
In our previous class, we discussed the Round Robin Scheduling Algorithm.
Non Preemptive Priority Scheduling Algorithm
The Priority Scheduling Algorithms are of two types.
1. Non Preemptive Priority Scheduling Algorithm
2. Preemptive Priority Scheduling Algorithm
In this class, we will discuss Non Preemptive Priority Scheduling Algorithm.
In the next class, we will discuss Preemptive Priority Scheduling Algorithm.
In the non-preemptive priority scheduling algorithm, the selection of processes from the ready pool to the running state is made based on the process’s priority.
Each process will be allocated a priority based on the priority we will select the process.
As this is non-preemptive priority scheduling, once the process enters the running state, it will not be preempted.
Even though a high-priority process enters the present running process will not be preempted.
For a better understanding of the concept, consider the example shown below.
Generally, the process with the highest priority number will have low priority, and the process with the lowest priority will have high priority.
At arrival time 0, we have only one process, P1, so that P1 will be executed.
As the burst time of P1 is three units in time after the completion of the execution of process P1, Process P2, P3, and P4 will be in the ready pool.
Now, from these processes, which process has to be chosen?
The choice of the processes is made based on priority.
Among the above processes, P3 has the highest priority. So, P3 will get switched for execution.
After P3 execution, all processes arrived.
Among P2, P4, and P5, P5 has the highest priority, so that P5 will get executed.
After the execution of P5, P2 and P5 will get executed.
Using the below Gantt Chart, we will find the Completion Time, Turn Around Time, and Waiting Time for all the processes.