In this video, we will be studying in detail about one of the CPU scheduling algorithm - Preemptive priority scheduling.
What is Preemptive Priority CPU Scheduling Algorithm?
This algorithm schedules processes based on their priority. A higher priority process is scheduled first as compared to a lower priority process. If multiple processes have the same priority, then processes are scheduled in first-come-first-serve basis. It uses a rank based system to define the rank for each process, such that lower rank processes have higher priority and higher rank processes have lower priority.
Advantages of Preemptive priority scheduling algorithm:
This algorithm provides a good mechanism where the relative importance of each process may be precisely defined. It is easy to implement when priorities are clearly defined & is beneficial for multiprogramming environment.
Disadvantages of Preemptive priority scheduling algorithm:
Preemptive Priority Scheduling may suffer from starvation when newer processes with higher priority keep entering the system and lower priority processes keep waiting for their turn on the CPU.
Ageing is the solution to the starvation problem.
After a fixed interval, the priority of a process is decremented which is waiting for a longer period of time. Requires frequent context switching when higher priority process keep entering the system.
Preemptive priority CPU scheduling algorithm:
https://www.geeksforgeeks.org/preemptive-priority-cpu-scheduling-algortithm/