Open In App

Difference between Multilevel Queue (MLQ) and Multi Level Feedback Queue (MLFQ) CPU scheduling algorithms

Last Updated : 03 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In multi programming environment, it often happens that more than one processes compete for CPU resources at the same time. If only one CPU is available choice has to be made between processes to run next. Part of the Operating System responsible for making choice of process is called Scheduler and the algorithm it used is called Scheduling Algorithm. 

The objective of multi programming is to maximize CPU utilization. Criteria like Turnaround time, Response time, Waiting time, Throughput are suggested on basis of which scheduling algorithms are judged. There are many CPU scheduling algorithms two of which are- 

  1. Multilevel Queue Scheduling 
  2. Multilevel Feedback Queue Scheduling 

Difference between Multilevel Queue (MLQ) and Multi Level Feedback Queue (MLFQ) CPU scheduling algorithms :  

Multilevel queue scheduling (MLQ) Multilevel feedback queue scheduling (MLFQ)
It is queue scheduling algorithm in which ready queue is partitioned into several smaller queues and processes are assigned permanently into these queues. The processes are divided on basis of their intrinsic characteristics such as memory size, priority etc. In this algorithm, ready queue is partitioned into smaller queues on basis of CPU burst characteristics. The processes are not permanently allocated to one queue and are allowed to move between queues.
In this algorithm queue are classified into two groups, first containing background processes and second containing foreground processes. 
80% CPU time is given to foreground queue using Round Robin Algorithm and 20% time is given to background processes using First Come First Serve Algorithm. 
 
Here, queues are classified as higher priority queue and lower priority queues. If process takes longer time in execution it is moved to lower priority queue. 
Thus, this algorithm leaves I/O bound and interactive processes in higher priority queue. 
 
The priority is fixed in this algorithm. When all processes in one queue get executed completely then only processes in other queue are executed. 
Thus, starvation can occur. 
 
The priority for process is dynamic as process is allowed to move between queue. A process taking longer time in lower priority queue can be shifted to higher priority queue and vice versa. 
Thus, it prevents starvation. 
 
Since, processes do not move between queues, it has low scheduling overhead and is inflexible. Since, processes are allowed to move between queues, it has high scheduling overhead and is flexible.

1. Example for Multilevel Queue Scheduling (MLQ) : 
A multilevel Queue with five queue is listed below according to order of priority. 
 

  1. System Process Queue 
  2. Interactive Processes Queue 
  3. Interactive Editing Processes Queue 
  4. Batch Processes Queue 
  5. Student Processes Queue 

Here, all queues have their own scheduling algorithm, and process is chosen with highest priority. Then it is executed preemptive or non-preemptively. No process in lower priority queue can get executed until higher process queue are all empty. 

For example, if batch process queue is running and interactive process comes in ready state batch process is preempted and interactive process is allowed to execute. 

2. Example for Multilevel Feedback Queue Scheduling (MLFQ) : 
Now, let us consider multilevel feedback queue with three queues. 
 

  1. A Round Robin queue with time quantum of 8 milliseconds, say Q1. 
  2. A Round Robin queue with time quantum of 16 milliseconds, say Q2. 
  3. A First Come First Serve queue, say Q3. 

Now, when the process enters Q1 it is allowed to execute and if it does not complete in 8 milliseconds it is shifted to Q2 and receives 16 milliseconds. Again it is preempted to Q3 if it does not complete in 16 seconds. In this manner, scheduling is carried on in this scheme.
 


Similar Reads

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 Multi Level Queue Scheduling (MLQ) and Priority Scheduling
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all processes. This is where multi-level queue scheduling is used. In this, processes are divided into various classes depending upon property of processes such as system process, I/O process, etc. Thus we get 'n' number of queues for n classes of proc
3 min read
Multilevel Queue (MLQ) CPU Scheduling
It may happen that processes in the ready queue can be divided into different classes where each class has its own scheduling needs. For example, a common division is a foreground (interactive) process and a background (batch) process. These two classes have different scheduling needs. For this kind of situation, Multilevel Queue Scheduling is used
6 min read
Difference between Multi Level Queue (MLQ) Scheduling and Round Robin (RR) algorithms
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all the processes. This is where multi-level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the processes such as system process, I/O process, etc. Thus we get 'n' number of queues for n
3 min read
Difference between Multi Level Queue Scheduling (MLQ) and First Come First Served (FCFS)
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all the processes. This is where multi level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the processes such as system process, I/O process etc. Thus we get 'n' number of queues for n c
3 min read
Difference between Multi Level Queue Scheduling (MLQ) and Shortest Job First
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all the processes. This is where multi level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the processes such as system process, I/O process etc. Thus we get 'n' number of queues for n c
3 min read
Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF)
1. Multi Level Queue Scheduling (MLQ) : It is quite difficult to have just one queue and schedule all processes. This is where multi-level queue scheduling is used. In this, processes are divided into various classes depending upon property of processes such as system process, I/O process, etc. Thus we get 'n' number of queues for n classes of proc
3 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
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