Multilevel Queue Scheduling
In Multilevel queue scheduling, the ready queue is divided into sub-queues and each process is assigned permanently to one of these sub-queue based on some process property like process priority, user, process size or process type etc. Each queue has its own scheduling algorithm and the queues themselves are also scheduled. For example, suppose there are two queues one for foreground processes and other for background processes. In foreground queue, the processes are scheduled using FCFS and in background queue processes are scheduled using SJF. The two queues themselves are scheduled using RR.
Example 1:
Process P1, P4 and P5 belong to queue Q1 and P2 and P3 belong to queue Q2. Processes in Q1 are scheduled using RR with time quantum 3 while processes in Q2 are scheduled using FCFS. Out of the two queue Q1 has higher priority over Q2 i.e. if there is any process in Q1 it will be scheduled first.
Waiting Time:
P1 : (0-0)+2=2 P2 : 6-1=5 P3 : 13-2=11
P4 : 3-2=1 P5 : 8-8=0
Av. Waiting Time = 19/5 = 3.8 (Ans)
Queues
Q1 and Q2 themselves are scheduled using RR (TQ=5)
Waiting Time:
P1 : 0 P2 : (3-2)=1 P3 : (13-2)+1=12
P4 : 8-4=4 P5 : (10-5)+5=5
Av. Waiting Time = 27/5 = 5.4 (Ans)