Operating System

Explain about multilevel feedback  Queue scheduling ?

Multilevel feedback queue scheduling (MLFQ) is a computer science algorithm that uses multiple queues to assign processes based on priority and resource usage history. The algorithm separates processes into ready queues based on their CPU burst characteristics and gives preference to processes with short CPU bursts or high I/O bursts. MLFQ then shifts processes between queues based on the CPU bursts of previous time slices. 

MLFQ is similar to multilevel queue (MLQ) scheduling, but MLFQ allows processes to move between queues. This makes MLFQ more efficient than MLQ. MLFQ has the following characteristics:

  • Flexibility: MLFQ is more flexible than MLQ.
  • Turnaround time: MLFQ optimizes turnaround time by learning from a process’s past behavior and predicting its future behavior.
  • Response time: MLFQ reduces response time. In MLFQ, a process is run for a time quantum. 

MFQS is designed to keep the central processing unit (CPU) busy by having some process running at all times. It extends standard algorithms by:

  • Separating processes into multiple ready queues based on their need for the processor
  • Giving preference to processes with short CPU bursts
  • Giving preference to processes with high I/O bursts 

MFQS dynamically adjusts priorities based on process behavior, promoting or demoting processes between queues. For example, if a process uses too much CPU time, it will be moved to a lower-priority queue. Similarly, a process that waits too long in a lower-priority queue may be moved to a higher-priority queue. 

The MLFQ algorithm is used in operating systems and is implemented in Linux and Windows. 

Here’s an example of MFQS:

  • A system has a CPU-bound process, which requires a burst time of 40 seconds
  • The MFQS scheduling algorithm is used
  • The queue time quantum is 2 seconds and in each level it is incremented by 5 seconds

MLFQ works by:

  • Separating processes into multiple ready queues based on their need for the processor
  • Giving preference to processes with short CPU bursts
  • Giving preference to processes with high I/O bursts
  • Moving processes between queues based on their behavior and performance 

MLFQ prevents starvation by moving processes with too much CPU to the lower priority queue and processes waiting too much for the CPU to the high priority queue. 

MLFQ is the most general scheme and also the most complex. One disadvantage of MLFQ is that processes moving around different queues leads to the production of more CPU overhead

Leave a Reply

Your email address will not be published. Required fields are marked *