SlideShare a Scribd company logo
1 of 5
Multi level queues and
feedback queue scheduling
Module II
Multi level queue
• 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 may
have different scheduling needs. In addition, foreground processes may have priority (externally defined)
over background processes.
• A multilevel queue scheduling algorithm partitions the ready queue into several separate queues (Figure
6.6).
• 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. 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 a Round Robin (RR) algorithm, while the background
queue is scheduled by an FCFS algorithm.
• There will be scheduling among the queues, which is commonly implemented as fixed-priority
preemptive scheduling.
• Usually, the foreground queue will have absolute priority over the background queue.
• E.g.: Multilevel queue scheduling algorithm with five
queues, listed below in order of priority:
1. System processes
2. Interactive processes
3. Interactive editing processes
4. Batch processes
5. Student processes
• Each queue has absolute priority over lower-priority queues.
• No process in the batch queue, for example, could run unless
the queues for system processes, interactive processes, and
interactive editing processes were all empty.
• If an interactive editing process entered the ready queue while
a batch process was running, the batch process would be
preempted.
• Another possibility is to time-slice among the queues.
• Here, each queue gets a certain portion of the CPU time,
which it can then schedule among its various processes.
• For instance, in the foreground–background queue
example, the foreground queue can be given 80 percent
of the CPU time for RR scheduling among its processes,
while the background queue receives 20 percent of the
CPU to give to its processes on an FCFS basis.
Multilevel Feedback Queue Scheduling
• Normally, when the multilevel queue scheduling algorithm is used, processes are permanently assigned to a queue when
they enter the system.
• This setup has the advantage of low scheduling overhead, but it is inflexible.
• The multilevel feedback queue scheduling algorithm, in contrast, allows a process to move between queues.
• The idea is to separate processes according to the characteristics of their CPU bursts.
• If a process uses too much CPU time, it will be moved to a lower-priority queue.
• This scheme leaves I/O-bound and interactive processes in the higher-priority queues.
• In addition, a process that waits too long in a lower-priority queue may be moved to a higher-priority queue. This form
of aging prevents starvation.
• In general, a multilevel feedback queue scheduler is defined by the following parameters:
• The number of queues
• The scheduling algorithm for each queue
• The method used to determine when to upgrade a process to a higher priority queue
• The method used to determine when to demote a process to a lower priority queue
• The method used to determine which queue a process will enter when that process needs service
• The definition of a multilevel feedback queue scheduler makes it the most general CPU-scheduling algorithm.
• It can be configured to match a specific system under design.
• Disadvantage: It is the most complex algorithm, since defining the best scheduler requires some means by which to select
values for all the parameters.
• Consider a multilevel feedback queue scheduler with three queues,
numbered from 0 to 2 (Figure 6.7).
• A process entering the ready queue is put in queue 0.
• A process in queue 0 is given a time quantum of 8 milliseconds.
• If it does not finish within this time, it is moved to the tail of queue
1.
• If queue 0 is empty, the process at the head of queue 1 is given a
quantum of 16 milliseconds.
• If it does not complete, it is preempted and is put into queue 2.
• Processes in queue 2 are run on an FCFS basis but are run only
when queues 0 and 1 are empty.
• This scheduling algorithm gives highest priority to any process with a
CPU burst of 8 milliseconds or less.
• Such a process will quickly get the CPU, finish its CPU burst, and
go off to its next I/O burst.
• Processes that need more than 8 but less than 24 milliseconds
are also served quickly, although with lower priority than shorter
processes.
• Long processes automatically sink to queue 2 and are served in
FCFS order with any CPU cycles left over from queues 0 and 1.
Example: Multilevel Feedback Queue Scheduling

More Related Content

Similar to RTOS_Module 2_3_multilevelqueues.pptx

21 process scheduling alogorithm
21 process scheduling alogorithm21 process scheduling alogorithm
21 process scheduling alogorithm
myrajendra
 

Similar to RTOS_Module 2_3_multilevelqueues.pptx (20)

21 process scheduling alogorithm
21 process scheduling alogorithm21 process scheduling alogorithm
21 process scheduling alogorithm
 
Cpu scheduling final
Cpu scheduling finalCpu scheduling final
Cpu scheduling final
 
Lecture 4 process cpu scheduling
Lecture 4   process cpu schedulingLecture 4   process cpu scheduling
Lecture 4 process cpu scheduling
 
Cpu scheduling pre final formatting
Cpu scheduling pre final formattingCpu scheduling pre final formatting
Cpu scheduling pre final formatting
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processes
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdf
 
Process scheduling & time
Process scheduling & timeProcess scheduling & time
Process scheduling & time
 
Operating system
Operating systemOperating system
Operating system
 
Planificacion
PlanificacionPlanificacion
Planificacion
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design
 
Operating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingOperating system 28 fundamental of scheduling
Operating system 28 fundamental of scheduling
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Recently uploaded (20)

Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 

RTOS_Module 2_3_multilevelqueues.pptx

  • 1. Multi level queues and feedback queue scheduling Module II
  • 2. Multi level queue • 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 may have different scheduling needs. In addition, foreground processes may have priority (externally defined) over background processes. • A multilevel queue scheduling algorithm partitions the ready queue into several separate queues (Figure 6.6). • 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. 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 a Round Robin (RR) algorithm, while the background queue is scheduled by an FCFS algorithm. • There will be scheduling among the queues, which is commonly implemented as fixed-priority preemptive scheduling. • Usually, the foreground queue will have absolute priority over the background queue.
  • 3. • E.g.: Multilevel queue scheduling algorithm with five queues, listed below in order of priority: 1. System processes 2. Interactive processes 3. Interactive editing processes 4. Batch processes 5. Student processes • Each queue has absolute priority over lower-priority queues. • No process in the batch queue, for example, could run unless the queues for system processes, interactive processes, and interactive editing processes were all empty. • If an interactive editing process entered the ready queue while a batch process was running, the batch process would be preempted. • Another possibility is to time-slice among the queues. • Here, each queue gets a certain portion of the CPU time, which it can then schedule among its various processes. • For instance, in the foreground–background queue example, the foreground queue can be given 80 percent of the CPU time for RR scheduling among its processes, while the background queue receives 20 percent of the CPU to give to its processes on an FCFS basis.
  • 4. Multilevel Feedback Queue Scheduling • Normally, when the multilevel queue scheduling algorithm is used, processes are permanently assigned to a queue when they enter the system. • This setup has the advantage of low scheduling overhead, but it is inflexible. • The multilevel feedback queue scheduling algorithm, in contrast, allows a process to move between queues. • The idea is to separate processes according to the characteristics of their CPU bursts. • If a process uses too much CPU time, it will be moved to a lower-priority queue. • This scheme leaves I/O-bound and interactive processes in the higher-priority queues. • In addition, a process that waits too long in a lower-priority queue may be moved to a higher-priority queue. This form of aging prevents starvation. • In general, a multilevel feedback queue scheduler is defined by the following parameters: • The number of queues • The scheduling algorithm for each queue • The method used to determine when to upgrade a process to a higher priority queue • The method used to determine when to demote a process to a lower priority queue • The method used to determine which queue a process will enter when that process needs service • The definition of a multilevel feedback queue scheduler makes it the most general CPU-scheduling algorithm. • It can be configured to match a specific system under design. • Disadvantage: It is the most complex algorithm, since defining the best scheduler requires some means by which to select values for all the parameters.
  • 5. • Consider a multilevel feedback queue scheduler with three queues, numbered from 0 to 2 (Figure 6.7). • A process entering the ready queue is put in queue 0. • A process in queue 0 is given a time quantum of 8 milliseconds. • If it does not finish within this time, it is moved to the tail of queue 1. • If queue 0 is empty, the process at the head of queue 1 is given a quantum of 16 milliseconds. • If it does not complete, it is preempted and is put into queue 2. • Processes in queue 2 are run on an FCFS basis but are run only when queues 0 and 1 are empty. • This scheduling algorithm gives highest priority to any process with a CPU burst of 8 milliseconds or less. • Such a process will quickly get the CPU, finish its CPU burst, and go off to its next I/O burst. • Processes that need more than 8 but less than 24 milliseconds are also served quickly, although with lower priority than shorter processes. • Long processes automatically sink to queue 2 and are served in FCFS order with any CPU cycles left over from queues 0 and 1. Example: Multilevel Feedback Queue Scheduling