15.6 – Queues 15.6 – Queues 15.6 – javafoundations.Queue 15.7 ...
Multilevel Queues
-
Upload
navdeep-walia -
Category
Documents
-
view
228 -
download
0
Transcript of Multilevel Queues
-
7/27/2019 Multilevel Queues
1/15
-
7/27/2019 Multilevel Queues
2/15
Multilevel Queue SchedulingAnother class of scheduling algorithms has been
created for situations in which processes are easilyclassified into different groups.
For example, a common division is made betweenforeground (interactive) processes and background(batch) processes.
These two types of processes have different response-time requirements, and so might have differentscheduling needs.
-
7/27/2019 Multilevel Queues
3/15
-
7/27/2019 Multilevel Queues
4/15
Different Types of Processes Interactive processes: Those which require input
from users and which interact with the system anduser maximum time.
CPU Bound Processes
I/O Bound Processes
Real Time Processes
-
7/27/2019 Multilevel Queues
5/15
Multilevel Queue Scheduling In addition foreground processes may have priority
over background processes.
A multilevel queue-scheduling algorithm partitionsthe ready queue into several separate queues.
The processes are permanently assigned to one queue,generally based on some property of the process, suchas memory size, process priority or process type.
-
7/27/2019 Multilevel Queues
6/15
Multilevel Queue Scheduling Each queue has its own scheduling algorithm. For
example, separate queues might be used forforeground and background processes.
The foreground queue might be scheduled by an RRalgorithm, while the background queue is scheduledby an FCFS algorithm.
So the general idea of a multi-level queue is as follows:You have several queues, each has a level whichcorresponds to a level of priority.
-
7/27/2019 Multilevel Queues
7/15
Multilevel Queue Scheduling So you might have:
Queue 1: High Priority, Shortest Job FirstQueue 2: Medium Priority, Round-Robin 10msQuantumQueue 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 CPUtime, Q3 gets the remaining 15%.
-
7/27/2019 Multilevel Queues
8/15
Multilevel Queue Scheduling
-
7/27/2019 Multilevel Queues
9/15
Multilevel Queue Scheduling Each queue has priority over lower priority queues.
No process in batch queue could run unless all theabove queues were all empty.
If system process entered the ready queue while the
interactive editing process was running, the interactiveediting process would be preempted.
-
7/27/2019 Multilevel Queues
10/15
Multilevel Queue Scheduling Since processes do not move between queue so, this
policy has the advantage of low scheduling overhead,but it is inflexible.
-
7/27/2019 Multilevel Queues
11/15
Multilevel Feedback Queue MLFQ is an extension of MLQ scheduling where the
processes can move from one queue to another queuebut in MLQ scheduling processes are assigned to a
fixed queue
A process can move between various queues; aging canbe implemented this way.
If a process waits too long in a lower-priority queue
may be moved to a higher-priority queue.
-
7/27/2019 Multilevel Queues
12/15
-
7/27/2019 Multilevel Queues
13/15
-
7/27/2019 Multilevel Queues
14/15
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 Q0which is servedFCFS
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 additionalmilliseconds If it still does not complete, it is preempted and moved to queue Q2
-
7/27/2019 Multilevel Queues
15/15
Example of Multilevel Feedback
Queue