Open In App

Advantages and Disadvantages of various CPU scheduling algorithms

Last Updated : 12 May, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

CPU Scheduling involves many different scheduling algorithms which have their Advantages and Disadvantages. 

1. First Come First Serve (FCFS): 

Advantages:

  1. It is simple and easy to understand.
  2. FCFS provides fairness by treating all processes equally and giving them an equal opportunity to run.
  3. FCFS guarantees that every process will eventually get a chance to execute, as long as the system has enough resources to handle all the processes.
  4. FCFS has low scheduling overhead since it does not involve frequent context switches or complex scheduling decisions. 
  5. FCFS is well-suited for long-running processes or workloads that do not have strict time constraints. 

Disadvantages:

  1. The process with less execution time suffers i.e. waiting time is often quite long.
  2. Favors CPU Bound process then I/O bound process.
  3. Here, the first process will get the CPU first, other processes can get the CPU only after the current process has finished its execution. Now, suppose the first process has a large burst time, and other processes have less burst time, then the processes will have to wait more unnecessarily, this will result in more average waiting time, i.e., Convoy effect.
  4. This effect results in lower CPU and device utilization.
  5. FCFS algorithm is particularly troublesome for multiprogramming systems, where it is important that each user get a share of the CPU at regular intervals. 

2. Shortest Job First (SJF) [Preemptive and Non- Preemptive]: 

Advantages:

  1. Shortest jobs are favored.
  2. It is probably optimal, in that it gives the minimum average waiting time for a given set of processes.

Disadvantages:

  1. SJF may cause starvation if shorter processes keep coming. This problem is solved by aging.
  2. It cannot be implemented at the level of short-term CPU scheduling.

3. Round Robin (RR): 

Advantages:

  1. Every process gets an equal share of the CPU.
  2. RR is cyclic in nature, so there is no starvation.

Disadvantages:

  1. Setting the quantum too short increases the overhead and lowers the CPU efficiency, but setting it too long may cause a poor response to short processes.
  2. The average waiting time under the RR policy is often long.
  3. If time quantum is very high then RR degrades to FCFS.

4. Priority Based (PB):  

Advantages:

  • This provides a good mechanism where the relative importance of each process may be precisely defined.
  • PB scheduling allows for the assignment of different priorities to processes based on their importance, urgency, or other criteria.

Disadvantages:

  1. If high-priority processes use up a lot of CPU time, lower-priority processes may starve and be postponed indefinitely. The situation where a process never gets scheduled to run is called starvation.
  2. Another problem is deciding which process gets which priority level assigned to it.

5. Multilevel Queue Scheduling (MQS): 

Advantages:

Application of separate scheduling for various kinds of processes is possible. 

  • System Process – FCFS
  • Interactive Process – SJF
  • Batch Process – RR
  • Student Process – PB

Disadvantages:

  • The lowest level process faces the starvation problem.

6. Multilevel Feedback Queue Scheduling (MFQS): 

Advantages:

  1. Low scheduling overhead.
  2. Allows aging, thus no starvation.

Disadvantages:

  1. It’s not flexible.
  2. It also requires some means of selecting values for all the parameters to define the best scheduler, thus it is also the most complex. 

Similar Reads

Advantages and Disadvantages of various Disk scheduling algorithms
Prerequisite - Disk Scheduling Algorithms 1. First Come First Serve (FCFS) : Advantages - First Come First Serve algorithm has a very simple logic, it executes the process requests one by one in the sequence they arrive. Thus, First Come First Serve is very simple and easy to understand and implement. In FCFS eventually, each and every process gets
3 min read
Advantages and Disadvantages of various Page Replacement algorithms
Page Scheduling, involves many different algorithms which have their Advantages and Disadvantages. 1. First In First Out (FIFO): Advantages -It is simple and easy to understand & implement.It is efficiently used for small systemsIt does not cause more overheadsSimplicity: FIFO is a simple and easy-to-implement algorithm. It does not require com
6 min read
Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
1. Priority Scheduling Algorithm : Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by the system depending upon the number o
3 min read
Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling
Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling is like Multilevel Queue(MLQ) Scheduling but in this process can move between the queues. And thus, much more efficient than multilevel queue scheduling. Characteristics of Multilevel Feedback Queue Scheduling: In a multilevel queue-scheduling algorithm, processes are permanently assigned t
5 min read
Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
Prerequisite - CPU Scheduling Priority Scheduling : In priority scheduling, each process has a priority which is an integer value assigned to it. The smallest integer is considered as the highest priority and the largest integer is considered as the lowest priority. The process with the highest priority gets the CPU first. In rare systems, the larg
4 min read
Difference between SJF and LJF CPU scheduling algorithms
Shortest Job First: The shortest job first (SJF) algorithm is a CPU scheduling algorithm designed to reorder the jobs so that the process having the smallest burst time is chosen for the next execution. It is used to reduce the average waiting time for other processes waiting for execution. This may be preemptive or non-preemptive. Its preemptive v
4 min read
Difference between FCFS and SJF CPU scheduling algorithms
1. First Come First Served (FCFS) : First Come First Served (FCFS) is the simplest type of algorithm. It is a non-preemptive algorithm i.e. the process cannot be interrupted once it starts executing. The FCFS is implemented with the help of a FIFO queue. The processes are put into the ready queue in the order of their arrival time. The process that
3 min read
Difference between SJF and SRJF CPU scheduling algorithms
1. Shortest Job First (SJF) : The Shortest Job First (SJF) is a scheduling policy that selects the waiting process with the smallest execution time to execute next. It is also known as Shortest Job Next (SJN) or Shortest Process Next (SPN). It is a non-preemptive scheduling algorithm. 2. Shortest Remaining Job First (SRTF) : The Shortest Remaining
2 min read
Difference between SRJF and LRJF CPU scheduling algorithms
1. Shortest remaining job first (SRJF) : Shortest remaining job first also called the shortest remaining time first is the preemptive version of the shortest job first scheduling algorithm. In the shortest remaining job first, the process with the smallest runtime to complete (i.e remaining time) is scheduled to run next, In SRJF, a running process
3 min read