menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Multi-Leve...
source image

Medium

4d

read

81

img
dot

Image Credit: Medium

Multi-Level Feedback Queue

  • The Multi-Level Feedback Queue (MLFQ) is a policy that combines fair and unfair approaches to achieve a balance between response time and turnaround time.
  • MLFQ has multiple job queues with priority levels where jobs in the highest non-empty queue run in Round Robin at a given moment.
  • The scheduler assigns priorities based on queue levels, with jobs moving to lower queues if they need more time to complete.
  • MLFQ addresses real-life constraints by not requiring prior knowledge of job runtimes.
  • The code provided includes classes for job queues, scheduler, and methods for job management in the MLFQ system.
  • MLFQ also incorporates rules like job priority assignment, time allotment, and dealing with long-running jobs to prevent starvation.
  • A priority boost mechanism in MLFQ prevents job starvation by moving all jobs to the highest queue after a certain period.
  • The scheduler's behavior changes when new jobs enter, and adjustments are made to ensure fairness and prevent job starvation.
  • I/O requests and their impact on job scheduling are noted, although they are not implemented in the provided code for simplicity.
  • MLFQ combines aspects of fairness and priority, providing interactive jobs with shorter time slices and long-running jobs with longer time slices.

Read Full Article

like

4 Likes

For uninterrupted reading, download the app