ArticleslgStudy

computer science

Multilevel feedback queue

Multilevel feedback queue is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Multilevel feedback queue rather than just read about it. In short: In computer science, a multilevel feedback queue is a scheduling algorithm. Scheduling algorithms are designed to have some process running at all times to keep the central processing unit (CPU) busy.

Key takeaways

  • Multilevel feedback queue belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Multilevel feedback queue to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Multilevel feedback queue from memory before moving on to harder problems.

Reference excerpt

In computer science, a multilevel feedback queue is a scheduling algorithm. Scheduling algorithms are designed to have some process running at all times to keep the central processing unit (CPU) busy. The multilevel feedback queue extends standard algorithms with the following design requirements:

Separate processes into multiple ready queues based on their need for the processor. Give preference to processes with short CPU bursts. Give preference to processes with high I/O bursts. (I/O bound processes will sleep in the wait queue to give other processes CPU time.) The multilevel feedback queue was first developed by Fernando J. Corbató (1962). For this accomplishment, the Association for Computing Machinery awarded Corbató the Turing Award.

Process scheduling Whereas the multilevel queue algorithm keeps processes permanently assigned to their initial queue assignments, the multilevel feedback queue shifts processes between queues. The shift is dependent upon the CPU bursts of prior time-slices.

If a process uses too much CPU time, it will be moved to a lower-priority queue. If a process is I/O-bound or an interactive process, it will be moved to a higher-priority queue. If a process is waiting too long in a low-priority queue and starving, it will be aged to a higher-priority queue.

Algorithm Multiple FIFO queues are used and the operation is as follows:

A new process is inserted at the end (tail) of the top-level FIFO queue. At some stage the process reaches the head of the queue and is assigned the CPU. If the process is completed within the time slice of the given queue, it leaves the system. If the process voluntarily relinquishes control of the CPU, it leaves the queuing network, and when the process becomes ready again it is inserted at the tail of the same queue which it relinquished earlier. If the process uses all the quantum time, it is pre-empted and inserted at the end of the next lower-level queue. This next lower-level queue will have a time quantum that is more than that of the previous higher-level queue. This scheme will continue until the process completes or it reaches the base-level queue. At the base level queue the processes circulate in round robin fashion until they complete and leave the system. Processes in the base level queue can also be scheduled on a first-come, first-served basis. Optionally, if a process blocks for I/O, it is promoted one level, and placed at the end of the next-higher queue. This allows I/O bound processes to be favored by the scheduler and allows processes to escape the base-level queue. For scheduling, the scheduler always starts picking up processes from the head of the highest-level queue. Only if the highest-level queue has become empty will the scheduler take up a process from the next lower-level queue. The same policy is implemented for picking up in the subsequent lower-level queues. A new process is always inserted at the tail of the top-level queue with the assumption that it will complete in a short amount of time. Long processes will automatically sink to lower-level queues based on their time consumption and interactivity level. In the multilevel feedback queue a process is given just one chance to complete at a given queue level before it is forced down to a lower-level queue. A new process added to any of the higher-level queues, will preempt a process executing from any lower-level queue.

Scheduling parameters In general, a multilevel feedback queue scheduler is defined by the following parameters:

The number of queues. The scheduling algorithm for each queue which can be different from FIFO. The method used to determine when to promote 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.

See also Lottery scheduling Fair-share scheduling Round-robin scheduling

References

External links Multilevel Feedback Queue Schedulers — Solaris 2.6 Time-Sharing Processor Sharing Queueing Models of Mixed Scheduling Disciplines for Time Shared System

Worked examples

Example 1 — a first encounter with Multilevel feedback queue

Start with the simplest possible case. Write down what Multilevel feedback queue claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Multilevel feedback queue before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Multilevel feedback queue ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Multilevel feedback queue

In research
Multilevel feedback queue appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Multilevel feedback queue in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Multilevel feedback queue is common in secondary-school and first-year university syllabi. It links to neighbouring topics Processor scheduling algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Multilevel feedback queue outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Multilevel feedback queue in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Multilevel feedback queue means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Multilevel feedback queue out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Multilevel feedback queue in simple terms?

In computer science, a multilevel feedback queue is a scheduling algorithm. Scheduling algorithms are designed to have some process running at all times to keep the central processing unit (CPU) busy.

Why does Multilevel feedback queue matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Multilevel feedback queue?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Multilevel feedback queue.

Tags

  • Processor scheduling algorithms

Keep exploring