Anda di halaman 1dari 15

Multilevel Queue Scheduling

Another class of scheduling algorithms has been

created for situations in which processes are easily classified into different groups.
For example, a common division is made between

foreground (interactive) processes and background (batch) processes.


These two types of processes have different response-

time requirements, and so might have different scheduling needs.

Different Types of Processes


In multilevel CPU scheduling we divide the queue into

a number of multiple queues which are divided depending upon the type of processes that are required to be scheduled.
Batch Processes: Those which do not require human

interaction while performing its run, they run without human intervention.

Different Types of Processes


Interactive processes: Those which require input

from users and which interact with the system and user maximum time.
CPU Bound Processes
I/O Bound Processes Real Time Processes

Multilevel Queue Scheduling


In addition foreground processes may have priority

over background processes.


A multilevel queue-scheduling algorithm partitions

the ready queue into several separate queues.


The processes are permanently assigned to one queue,

generally based on some property of the process, such as memory size, process priority or process type.

Multilevel Queue Scheduling


Each queue has its own scheduling algorithm. For

example, separate queues might be used for foreground and background processes.
The foreground queue might be scheduled by an RR

algorithm, while the background queue is scheduled by an FCFS algorithm.


So the general idea of a multi-level queue is as follows:

You have several queues, each has a level which corresponds to a level of priority.

Multilevel Queue Scheduling


So you might have:

Queue 1: High Priority, Shortest Job First Queue 2: Medium Priority, Round-Robin 10ms Quantum Queue 3: Low Priority, Round Robin 100 ms Quantum Then overall queue could be a priority queue.
So Q1 gets 50% of CPU time, Q2 gets 35% of the CPU

time, Q3 gets the remaining 15%.

Multilevel Queue Scheduling

Multilevel Queue Scheduling


Each queue has priority over lower priority queues.
No process in batch queue could run unless all the

above queues were all empty.


If system process entered the ready queue while the

interactive editing process was running, the interactive editing process would be preempted.

Multilevel Queue Scheduling


Since processes do not move between queue so, this

policy has the advantage of low scheduling overhead, but it is inflexible.

Multilevel Feedback Queue


MLFQ is an extension of MLQ scheduling where the

processes can move from one queue to another queue but in MLQ scheduling processes are assigned to a fixed queue
A process can move between various queues; aging can

be implemented this way.


If a process waits too long in a lower-priority queue

may be moved to a higher-priority queue.

Multilevel Feedback Queue


If a process uses too much CPU time, it will be moved

to lower-priority queues. This leaves I/O bound and interactive processes in the higher-priority queues.
In general, the multilevel feedback queue scheduling

algorithm is the most complex.


The idea is to separate processes according to

characteristics of their CPU bursts.

Multilevel Feedback Queue


Multilevel-feedback-queue scheduler defined by the

following parameters:
number of queues scheduling algorithms for each queue method used to determine when to upgrade a process method used to determine when to demote a process method used to determine which queue a process will

enter when that process needs service

Example of Multilevel Feedback Queue


Three queues: Q0 RR with time quantum 8 milliseconds Q1 RR time quantum 16 milliseconds Q2 FCFS
Scheduling A new job enters queue Q0 which is served FCFS

When it gains CPU, job receives 8 milliseconds If it does not finish in 8 milliseconds, job is moved to queue Q1

At Q1 job is again served FCFS and receives 16 additional

milliseconds

If it still does not complete, it is preempted and moved to queue Q2

Example of Multilevel Feedback Queue

Anda mungkin juga menyukai