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 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, SJF, LJF, etc. At the same time in different queues.
- Disadvantages –
The lowest level processes suffer from the starvation problem.
2. Longest Job First (LJF) :
Longest Job First is a non-preemptive scheduling algorithm. This algorithm is based upon burst time of processes. The processes are put into ready queue based on their burst times i.e., in descending order of burst times. As the name suggests this algorithm is based upon fact that process with largest burst time is processed first. The burst time of only those processes is considered that have arrived in system until that time. Its preemptive version is called Longest Remaining Time First (LRTF) algorithm.
If two processes have the same burst time then tie is broken using FCFS i.e., process that arrived first is processed first.
- This algorithm gives very high average waiting time and average turn-around time for a given set of processes.
- This may lead to convoy effect.
- It may happen that a short process may never get executed and system keeps on executing longer processes.
- It reduces processing speed and thus reduces efficiency and utilisation of system.
Difference between Longest Job First (LJF) and Multi Level Queue Scheduling (MLQ) :
|S.NO.||Longest Job First (LJF)||Multi Level Queue (MLQ)|
|1.||It executes processes based upon their burst time i.e. in descending order of their burst times.||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.|
|2.||It is non-preemptive but its preemptive version is also there called Shortest Remaining Time First (SRTF) algorithm.||It can be both preemptive and non preemptive in nature depending upon conditions.|
|3.||The average waiting time for given set of processes is quite long which reduces effectiveness of system.||There is no idea of average waiting time and response time as it completely depends upon algorithms used in various levels of multi-level queue.|
|4.||A long process may never get executed and system may keep executing short processes.||It leads to starvation of processes at lower levels of multi level queue.|
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 Multi Level Queue Scheduling (MLQ) and Shortest Job First
- 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 First Come First Served (FCFS) and Longest Job First (LJF) CPU scheduling algorithms
- Difference between Multi Level Queue (MLQ) Scheduling and Round Robin (RR) algorithms
- Difference between Longest Job First (LJF) and Round Robin (RR) scheduling algorithms
- Difference between Priority Scheduling and Longest Job First (LJF)
- Longest Job First (LJF) CPU scheduling algorithm
- Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Multilevel Queue (MLQ) CPU Scheduling
- Difference between SJF and LJF CPU scheduling algorithms
- Difference between LJF and LRJF CPU scheduling algorithms
- Difference between Shortest Job First (SJF) and Round-Robin (RR) scheduling algorithms
- Difference between Multi-tasking and Multi-threading
- Two Level Paging and Multi Level Paging in OS
- Multilevel Feedback Queue Scheduling (MLFQ) 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
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.