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 processes. Each queue is assigned a priority and can use its own scheduling algorithm which makes it convenient to use many scheduling algorithms at the same time. Generally, topmost level of queue has highest priority which decreases as we move to lower levels. If upper level has an absolute priority over lower levels then it is non-preemptive else if time slice is divided between various queues then it becomes preemptive in nature
- Advantages –
The major advantage of this algorithm is that we can use various algorithms such as FCFS, SJF, LJF, etc. At the same time in different queues.
- Disadvantages –
The lowest level processes suffer from starvation problem.
2. Priority Scheduling Algorithm :
Priority scheduling algorithm executes processes depending upon their priority. Each process is allocated a priority and process with highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by system depending upon number of resources required, time needed, etc. whereas external priorities are based upon time in which work is needed or amount being paid for work done or importance of process. Priority scheduling can be preemptive or non-preemptive.
- If two processes have same priority then tie is broken using FCFS.
- The waiting time for highest priority process is always zero in preemptive mode while it may not be zero in case of non-preemptive mode.
The major problem is starvation or indefinite blocking. It may so happen that in stream of processes, system keeps executing high priority processes and low priority processes never get executed.
Difference between MLQ and Priority Scheduling Algorithm :
|S.No.||Multi level queue scheduling (MLQ)||Priority scheduling|
|1.||Processes are executed depending on priority of that particular level of queue to which process belongs. Further selection of process is based upon type of algorithm used in that particular queue.||It executes processes based upon their priorities i.e. in descending order of their priorities. A process with higher priority is executed first.|
|2.||It can be both non-preemptive and preemptive in nature depending upon conditions.||It is both preemptive and non preemptive in nature.|
|3.||Average waiting time and average response time depends upon algorithms used in various levels of multi level queue for scheduling.||There is no idea of average waiting time and response time.|
|4.||It leads to starvation of processes at lower levels of multi-level queue.||The problem of blocking of a process can be solved through aging which means to gradually increase priority of a process after a fixed interval of time by a fixed number.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Multilevel Queue (MLQ) and Multi Level Feedback Queue (MLFQ) CPU scheduling algorithms
- Difference between Multi Level Queue (MLQ) Scheduling and Round Robin (RR) algorithms
- Difference between Multi Level Queue Scheduling (MLQ) and First Come First Served (FCFS)
- Difference between Multi Level Queue Scheduling (MLQ) and Shortest Job First
- Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF)
- Multilevel Queue (MLQ) CPU Scheduling
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
- Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Difference between Priority Inversion and Priority Inheritance
- Difference between Multi-tasking and Multi-threading
- Two Level Paging and Multi Level Paging in OS
- CPU Scheduling in Operating Systems using priority queue with gantt chart
- Difference between FCFS and Priority CPU scheduling
- Difference between Priority Scheduling and Longest Job First (LJF)
- Difference between User Level thread and Kernel Level thread
- Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling
- Relation in FCFS and Preemptive Priority Scheduling Algorithm
- Implementation of Non-Preemptive Shortest Job First using Priority Queue
- Relationship between User level thread and Kernel level thread
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.