1. Multi Level Queue Scheduling (MLQ) :
It is quite difficult to have just one queue and schedule all the processes. This is where multi level queue scheduling is used. In this the processes are divided into various classes depending upon the property of the 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 the topmost level of queue has the highest priority which decreases as we move to the lower levels. If the upper level has an absolute priority over lower levels then it is non preemptive else if the 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, SSJF, LJF, etc. At the same time in different queues.
- Disadvantages -
The lowest level processes suffer from starvation problem.
2. Shortest Job First (SJF) :
It is based upon the burst time of the process. The processes are put into the ready queue based on their burst times. In this algorithm, the process with the least burst time is processed first. The burst time of only those processes is compared that are present or have arrived until that time. It is also non-preemptive in nature. Its preemptive version is called
Shortest Remaining Time First (SRTF) algorithm.
The major advantage of this algorithm is that it gives the minimum waiting time for a given set of processes and thus reduces the average waiting time. The disadvantage of this algorithm is that long processes may never be processed by the system and may remain in the queue for very long time leading to starvation of processes.
Note -
If two processes have same burst time then the tie is broken using FCFS, i.e., the process that arrived first is processed first.
Difference between SJF and Multi Level Queue Scheduling :