Operating System

Explain about priority CPU scheduling  ?.

Priority scheduling is a method of scheduling processes based on priority. In this method, the scheduler chooses the tasks to work as per the priority, which is different from other types of scheduling, for example, a simple round robin.

Priority CPU scheduling is a CPU scheduling algorithm that assigns the CPU to the process with the highest priority. 

Here are some details about priority CPU scheduling:

  • Priority numbers
  • Each process is assigned a priority number. In some systems, a lower number means higher priority, while in others, a higher number means higher priority.

  • Scheduling
  • The CPU performs the task with the highest priority first. If two processes have the same priority, scheduling is done on a first-come, first-served basis.

  • Types
  • There are two types of priority scheduling: preemptive and non-preemptive.
    • Non-preemptive: Another process can only be executed once the current process is done executing.
    • Preemptive: A higher priority process pauses the current running process and completes its execution first.
  • Advantages
  • Priority scheduling is easy to use, saves time, and defines the importance of each process. It’s also a good algorithm for applications with fluctuating time and resource requirements.
  • Disadvantages
  • One disadvantage of the preemptive priority CPU scheduling algorithm is the starvation problem. This is when a process has to wait for a longer amount of time to get scheduled into the CPU. 

Leave a Reply

Your email address will not be published. Required fields are marked *