Difference between Multi Level Queue Scheduling (MLQ) and Priority Scheduling
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 upper level has an absolute priority over lower levels then it is non-preemptive else if 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 starvation problem.
2. Priority Scheduling Algorithm :
Priority scheduling algorithm executes processes depending upon their priority. Each process is allocated a priority and process with highest priority is executed first. Priorities can be defined internally as well as externally. Internal priorities are decided by system depending upon number of resources required, time needed, etc. whereas external priorities are based upon time in which work is needed or amount being paid for work done or importance of process. Priority scheduling can be 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.
The major problem is starvation or indefinite blocking. It may so happen that in stream of processes, system keeps executing high priority processes and low priority processes never get executed.
Difference between MLQ and Priority Scheduling Algorithm :