Greetings!We have recently published 100+ articles on android tutorials with kotlin and java. If you need, you may visit Android Tutorial for beginners page. You can also check Kotlin Tutorial for beginners. Also, if you are interested in content writing, you can mail us at email@example.com.
In this tutorial, we will learn about multilevel queue scheduling. We will also see different examples of multilevel queue scheduling.
Multilevel queue scheduling algorithm partitions the ready queue into several separate queues.
Multilevel queue scheduling has the following characteristics:
(A) Each queue has its own scheduling algorithm. For example given below, queue1(system process) uses FCFS (First Come First Serve), queue2(interactive process) uses SJF (Shortest Job First) while queue3 uses RR (Round Robin) to schedule their processes. For each queue, scheduling algorithm can be different or same.
(B) Processes are divided into different queues based on their process type, memory size and process priority.
Example of MultiLevel Queue Scheduling
Here, we will take 3 different types of processes called system processes, interactive processes and Batch processes. All the three processes have their own queue. Kindly look at below figure.
- System process has the highest priority. If an interrupt is generated in the system, then the Operating system stops all the processes and handle the interrupt. According to different response time requirements, process needs different scheduling algorithm.
- Interactive process has medium priority. If we are using VLC player, we directly interact with the application. So all these processes will come in an interactive process. These queues will use scheduling algorithm according to requirement.
- Batch processes has the lowest priority. The processes which run automatically in the background comes under the batch processes. It is also known as background processes.
Therefore, according to process priority and type, the processes are scheduled with different scheduling algorithm.
– Multilevel queue scheduling must be different in scheduling among the processes and generally are implemented as fixed preemptive priority scheduling.
– Another case is if there are no processes in system and interactive queues. Suppose we are executing batch processes in the queue and all were empty initially. Assume that a new process enters either the system or interactive queue. Then, we have to preempt batch process queue scheduling wherein we have to give high priority to the queue which are above the batch queue.
Problem in Multilevel Queue Scheduling
These processes can’t move across the queues.
- (Like if there are processes loaded in queues. Currently, we are executing the process which are in system queue. In this case, until all the processes is in system queue is completed, we can’t move to interactive process.)
So, Running process can be preempted from a low priority queue when process arrives at high priority queue.
Scheduling can lead to starvation.
- If dynamically process is entering in system queue, then other processes are lead to starvation. Since we have scheduled the process queue as high priority and low priority, neither process can jump across the queue nor process can switch over.