Multilevel Queue and Multilevel Feedback Queue Scheduling
- Process Management
- Memory Management
- Deadlocks
- OS Introduction & Fundamentals
- CPU Scheduling Algorithms
- Threads & Concurrency
- Inter-Process Communication (IPC)
- Process Synchronization
- Virtual Memory & Paging
- File Systems
- Disk Scheduling
- I/O Management
Not All Processes Have the Same Scheduling Needs
An interactive text editor benefits from Round Robin's responsiveness (covered earlier in this section), while a long batch computation is better suited to something like FCFS, without needing frequent, disruptive context switches. Multilevel Queue scheduling handles this by giving different categories of processes entirely different queues.
How a Multilevel Queue Is Structured
[ Queue 1: Interactive processes ] -- scheduled with Round Robin, checked first
[ Queue 2: Batch processes ] -- scheduled with FCFS, only runs when Queue 1 is emptyEach queue can use a completely different scheduling algorithm suited to that category of process, and queues themselves are typically prioritized - lower queues only get CPU time once all higher-priority queues are empty.
The Rigidity Problem: Fixed Queue Assignment
In a basic multilevel queue, a process is permanently assigned to one queue for its entire lifetime - a process that starts out behaving interactively but later becomes CPU-intensive stays stuck in the interactive queue (or vice versa), even once that classification no longer fits its actual behavior.
Multilevel Feedback Queue: Letting Processes Move Between Queues
Process uses its full time quantum without finishing
|
v
Demoted to a lower-priority queue (assumed to be more CPU-intensive)
Process voluntarily gives up the CPU early (e.g. waiting for I/O)
|
v
Can be promoted back to a higher-priority queue (assumed to be interactive)A Multilevel Feedback Queue solves the rigidity problem by letting processes move between queues based on their actual observed behavior - a process that keeps using its entire time slice gets demoted to a lower-priority queue, while one that frequently gives up the CPU early gets promoted, adapting dynamically rather than committing a process to one fixed category forever.
Why This Is Considered a Highly General, Flexible Approach
Multilevel Feedback Queue can be configured to closely approximate many of the other scheduling algorithms covered in this section, depending on how its parameters (number of queues, time quantum per queue, promotion/demotion rules) are set - which is exactly why many modern general-purpose operating systems build their actual scheduler around some variation of this idea.