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 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 the topmost level of queue has the highest priority which decreases as we move to the lower levels. If the upper level has an absolute priority over lower levels then it is non preemptive else if the 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, SSJF, LJF, etc. At the same time in different queues. - Disadvantages –
The lowest level processes suffer from starvation problem.
2. Shortest Job First (SJF) :
It is based upon the burst time of the process. The processes are put into the ready queue based on their burst times. In this algorithm, the process with the least burst time is processed first. The burst time of only those processes is compared that are present or have arrived until that time. It is also non-preemptive in nature. Its preemptive version is called Shortest Remaining Time First (SRTF) algorithm.
The major advantage of this algorithm is that it gives the minimum waiting time for a given set of processes and thus reduces the average waiting time. The disadvantage of this algorithm is that long processes may never be processed by the system and may remain in the queue for very long time leading to starvation of processes.
Note –
If two processes have same burst time then the tie is broken using FCFS, i.e., the process that arrived first is processed first.
Difference between SJF and Multi Level Queue Scheduling :
| Shortest Job First (SJF) | Multi Level Queue Scheduling (MLQ) |
|---|---|
| SJF is also non-preemptive but its preemptive version is also there called Shortest Remaining Time First (SRTF) algorithm. | MLQ can be non-preemptive or preemptive depending on the conditions. |
| It executes the processes in descending order of their burst time i.e. shortest job is executed first. | Processes are executed depending on the priority of that particular level of queue to which the process belongs. Further selection of process is based upon the type of algorithm used in that particular queue. |
| The overhead in SJF is due to the fact that time elapsed has to be recorded. | MLQ has some CPU overhead as it needs to switch between the queues. |
| Average waiting time is minimal in case of SJF. | Average waiting time depends upon the algorithms used in various levels of queues. |
| The major difficulty in its implementation is that length of next CPU burst is unknown. | It is complex algorithm and is difficult to implement. |
| It leads to starvation of processes which have very large burst times. | It leads to the starvation of processes at lower levels. |
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.
Recommended Posts:
- Difference between Multi Level Queue Scheduling (MLQ) and Longest Job First (LJF)
- Difference between Multi Level Queue Scheduling (MLQ) and First Come First Served (FCFS)
- Difference between Multi Level Queue Scheduling (MLQ) and Priority Scheduling
- 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 Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Difference between First Come First Served (FCFS) and Longest Job First (LJF) CPU scheduling algorithms
- Difference between Shortest Job First (SJF) and Round-Robin (RR) scheduling algorithms
- Multilevel Queue (MLQ) CPU Scheduling
- Program for Shortest Job First (or SJF) CPU Scheduling | Set 1 (Non- preemptive)
- Program for Shortest Job First (SJF) scheduling | Set 2 (Preemptive)
- Shortest Job First CPU Scheduling with predicted burst time
- Shortest Job First (or SJF) CPU Scheduling Non-preemptive algorithm using Segment Tree
- Implementation of Non-Preemptive Shortest Job First using Priority Queue
- Difference between Longest Job First (LJF) and Round Robin (RR) scheduling algorithms
- Difference between Priority Scheduling and Longest Job First (LJF)
- Difference between Multi-tasking and Multi-threading
- Two Level Paging and Multi Level Paging in OS
- Multilevel Feedback Queue Scheduling (MLFQ) CPU Scheduling
- Clairvoyant Shortest Job first (SJF)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. 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.

