What are the types of process scheduling algorithms and which algorithms lead to starvation?

Operating SystemHardwareSoftware & Coding

Process scheduler assigns different processes to CPU based on particular scheduling algorithms.

Types of Process Scheduling Algorithms

The different types of process scheduling algorithms are as follows −

FCFS

As the name goes, jobs are executed on a first come first serve basis. It’s a simple algorithm based on FIFO that's first in first out. It is pre-emptive and non pre-emptive and its performance is poor based on its average waiting time.

SJF

It is also known as the shortest job first or shortest job next. It is a pre-emptive and non pre-emptive type algorithm that is easy to implement in batch systems and is best in minimising the waiting time.

Round Robin

It is pre-emptive scheduling algorithm in which each process is given a fix time called quantum to execute. In this time one process is allowed to execute for a quantum and then pre-empts and then other process is executed. In this way there is context switching between processes to save states of these pre-empted processes.

Priority Scheduling

It is a non pre-emptive Algorithm that works in batch systems and in this each process is given a priority and the process with highest priority is executed first and others are executed according to priorities which can lead to starvation for those processes.

Shortest Remaining time

This algorithm is based on SJF and is the pre-emptive version of that and the process with shortest Remaining time goes for execution. In other words, the process which is closest to completion is executed first and it may be pre-empted to a new ready job that has a shorter time to execution.

Multiple levels queues Scheduling

In this scheduling multiple queues have their own scheduling Algorithms and are maintained with the processes that possess the same characteristics. For this, priority is assigned to each queue for the jobs to be executed.

The all above algorithms can be pre-emptive or non pre-emptive. It means in a preemptive process a scheduler can pre-empt a low priority running process if the high priority process comes in the ready queue. While in non pre-emptive once a process enters in running state it cannot be pre-empted.

Algorithms leading to Starvation

Now in SJF, if longer processes come, then they have to wait for longer times and hence this suffers from starvation. In round robin, there is no chance of starvation as each process is given quanta for execution or fixed time to execute.

In priority scheduling the longer processes with low priority keep in waiting and hence priority scheduling undergoes starvation as only high priority processes execute fast and low ones remain waiting.

In FCFS there is no chance of starvation in both the cases of longer or shorter processes. Eventually, every process gets to execute without waiting on a first come first serve basis.

raja
Updated on 30-Nov-2021 12:06:34

Advertisements