It may happen that processes in the ready queue belong to different classes where each class has its own scheduling needs. A common division is foreground (interactive) and background (batch) processes. These classes have different performance requirements and priorities; to handle such situations the Multilevel Queue (MLQ) Scheduling technique is used.
In Multilevel Queue Scheduling the ready queue is divided into several separate queues; each queue corresponds to a specific class of processes. Each queue may use a different scheduling algorithm and have a distinct priority relative to other queues. Typical classes include system processes, interactive processes and batch processes. Each class is permanently assigned to one queue and does not move between queues.

Each queue can use an appropriate scheduling policy. For example, queue 1 and queue 2 may use Round Robin while queue 3 uses FCFS (First-Come, First-Served).
When several queues are non-empty, the scheduler must decide which queue's processes get the CPU. Two common schemes are used:
Problem: Consider the table of four processes under Multilevel Queue scheduling where the queue number denotes the queue of each process.

Assume priority of queue 1 is greater than queue 2. Queue 1 uses Round Robin with time quantum = 2, and queue 2 uses FCFS. A possible Gantt chart for this situation is shown below.

Explanation of the Gantt chart:
Multilevel Feedback Queue (MLFQ) is an extension of the multilevel queue idea that allows processes to move between queues. The scheduler observes process behaviour (for example, how long a process runs before blocking for I/O) and dynamically adjusts the process's priority by moving it between queues. This provides greater flexibility and allows the system to approximate algorithms such as SJF (Shortest Job First) without knowing exact burst times in advance.

Implementations vary. For example, the last queue could use Round Robin instead of FCFS, or the demotion/promotion rules can differ.
A long-running process placed in a lower-priority queue can suffer starvation if many short processes keep arriving and occupying higher-priority queues.
A common solution is priority boosting: at regular intervals the scheduler raises the priority of waiting processes (for example, moving all processes back to the highest-priority queue). This prevents indefinite starvation and rebalances the system periodically.
Consider a system which has a CPU bound process, which requires the burst time of 40 seconds. The multilevel Feed Back Queue scheduling algorithm is used and the queue time quantum '2' seconds and in each level it is incremented by '5' seconds.Then how many times the process will be interrupted and on which queue the process will terminate the execution?
Solution:
Process P needs 40 seconds for total execution.
At queue 1 it executes for 2 seconds and is interrupted and shifted to queue 2.
At queue 2 the time quantum is 2 + 5 = 7 seconds; it executes for 7 seconds and is interrupted and shifted to queue 3.
At queue 3 the time quantum is 7 + 5 = 12 seconds; it executes for 12 seconds and is interrupted and shifted to queue 4.
At queue 4 the time quantum is 12 + 5 = 17 seconds; it executes for 17 seconds and is interrupted and shifted to queue 5.
By now the process has executed 2 + 7 + 12 + 17 = 38 seconds; 2 seconds remain.
At queue 5 the time quantum would be 17 + 5 = 22 seconds, but only 2 seconds of remaining CPU time are needed; the process executes for 2 seconds and then completes.
Hence the process is interrupted 4 times and finishes execution in queue 5.
Summary (optional): Multilevel Queue Scheduling is suitable when processes naturally fall into fixed classes with different scheduling needs; Multilevel Feedback Queue adds adaptability by allowing processes to change priority based on behaviour, reducing response time for interactive tasks and helping approximate short-job favouring policies while taking care to avoid starvation through mechanisms such as priority boosting.
| 1. What is Multilevel Queue (MLQ) CPU Scheduling? | ![]() |
| 2. What are the advantages of using MLQ CPU Scheduling? | ![]() |
| 3. How are processes classified in MLQ CPU Scheduling? | ![]() |
| 4. What happens when a process in a lower-priority queue needs CPU time? | ![]() |
| 5. Can MLQ CPU Scheduling lead to starvation of processes? | ![]() |
![]() | Explore Courses for Computer Science Engineering (CSE) exam |
![]() | Get EduRev Notes directly in your Google search |