Open In App

Difference between Multi Level Queue Scheduling (MLQ) and Priority Scheduling

Last Updated : 16 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Queue Scheduling refers to the process of managing and organizing tasks (or processes) that need to be executed by a system. In an operating system, tasks are often placed in queues waiting for CPU to execute them.

Queue scheduling helps the system decide which task to run next, and in what order, ensuring efficient and fair use of CPU.

Multi Level Queue Scheduling(MLQ)

It is quite difficult to manage all processes with just a single queue, that is where multi-level queue scheduling comes in. In this approach, processes are divided into different classes based on their characteristics, such as system processes, I/O processes, etc.

As a result, we get ‘n’ queues, one for each class of processes. Each queue is assigned a priority and can use its own scheduling algorithm, allowing multiple scheduling algorithms to be used simultaneously. Typically, topmost level of the queue has highest priority, and the priority decreases as you move to lower levels.

If upper levels have absolute priority over lower levels, the scheduling is non-preemptive. On the other hand, if time slices are divided between the various queues, scheduling becomes preemptive.

Priority Scheduling Algorithm

The Priority Scheduling algorithm executes processes based on their priority. Each process is assigned a priority, and the process with highest priority is executed first. Priorities can be defined both internally and externally. Internal priorities are determined by the system, based on factors such as number of resources required, the time needed, etc.

On the other hand, external priorities are based on factors like the urgency of the work, the amount paid for the task, or the importance of the process. Priority scheduling can be either preemptive or non-preemptive.

  • If two processes have same priority then tie is broken using FCFS.
  • The waiting time for highest priority process is always zero in preemptive mode while it may not be zero in case of non-preemptive mode.

Difference between MLQ and Priority Scheduling Algorithm

Features Multi level queue scheduling (MLQ) Priority scheduling
Handling 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. It executes processes based upon their priorities i.e. in descending order of their priorities. A process with higher priority is executed first.
Preemption Can be preemptive or non-preemptive depending on queue algorithms. Can be preemptive or non-preemptive depending on priority.
Waiting Time Average waiting time and average response time depends upon algorithms used in various levels of multi level queue for scheduling. There is no idea of average waiting time and response time.
Starvation It leads to starvation of processes at lower levels of multi-level queue. The problem of blocking of a process can be solved through aging which means to gradually increase priority of a process after a fixed interval of time by a fixed number.

Flexibility

Offers more flexibility by allowing different queues to have different scheduling algorithms based on process type.

Less flexible, uses one scheduling method for all.



Next Article

Similar Reads