What is Multilevel Queue Scheduling?
In multilevel queue scheduling, all the processes are assigned permanently to the queue at the time of entry. Processes will not move between queues and it may happen that the processes in the queue can be divided into different classes where classes have their own scheduling. For example, interactive process and batch process.
The main advantage of multilevel queue scheduling is that the processes are permanently assigned to the queue.
For example let’s take three different processes:
- System process
- Interactive process
- Batch process
- In system processes the CPU itself has their own process to run which is called system process.
- In an interactive process there should be the same type of interaction.
- Batch processing is a technique of the operating system which collects the programs and data in the form of a batch before the starting of the process.
Advantages of Multilevel Queue Scheduling:
- As MLQ assigns permanent queue to the processes therefore, it has an advantage of low scheduling overhead.
- We can use MLQ to apply different scheduling methods to distinct processes.
Disadvantages of MQL Scheduling:
- Some processes may face starvation as higher priority queues are never becoming empty.
- MQL is inexorable in nature.
Multilevel Feedback Queue scheduling:
In multilevel feedback scheduling, the processes are allowed to move in between the queues, the idea behind is to separate the processes with different CPU – burst characteristics. If any process uses too much CPU then it’ll be moved to the lower priority queue and if a process waiting too much for the CPU is moved to the high priority queue this prevents starvation. Multilevel feedback queue is the most general scheme and also the most complex.
Advantages of MLFQ:
- MLFQ allows different processes to move between different queues.
- It prevents starvation.
- MLFQ is more flexible.
Multilevel queue scheduling(MLQ) | Multilevel feedback queue scheduling(MLFQ) |
---|---|
In MLQ processes are assigned permanently into the queues. | In MLFQ processes are not assigned permanently to the queues. |
Processes are divided on the basis of their priorities or size. | Processes are divided on the basis of CPU burst characteristics. |
In this, queues are classified into two groups, background processes and foreground processes. | In this, queues are classified as higher priority queue and lower priority queue. |
In MLQ priority is fixed. | In MLFQ priority is dynamic as processes are allowed to move between the queues. |
As processes are not allowed to move in between queues therefore it has low scheduling overhead and is inflexible. | As in MLFQ processes are allowed to move in between queues therefore it has high scheduling overhead and is flexible. |
This article tried to discuss the Difference Between MLQ And MLFQ CPU Scheduling Algorithms . Hope this blog helps you understand the concept. To practice problems you can check out MYCODE | Competitive Programming at Prepbytes