Priority Scheduling Examples
Priority Scheduling is a CPU scheduling algorithm in which each process is assigned a priority, and the CPU always executes the process with the highest priority first.
Priority scheduling is a CPU scheduling algorithm in which a process with a higher priority is always executed first by the CPU. Priority is a numeric value, depending on the OS or scheduling policy; sometimes a smaller number indicates a higher priority and sometimes a higher number indicates a higher priority
Priority scheduling can be Preemptive or non-preemptive.
- In non-preemptive scheduling, once a process gets the CPU, it continues until it completes. A new incoming process never interrupts the currently executing process.
- In preemptive scheduling, once a process gets the CPU, it may be interrupted by the arrival of a higher-priority process. The higher-priority process immediately gets the CPU.
We will see various examples of priority preemptive and non-preemptive scheduling
Non-Preemptive Priority Scheduling Example 1