Multilevel feedback queue
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, a multilevel feedback queue is a
scheduling A schedule or a timetable, as a basic time-management tool, consists of a list of times at which possible task (project management), tasks, events, or actions are intended to take place, or of a sequence of events in the chronological order ...
algorithm. ''Scheduling algorithms'' are designed to have some process running at all times to keep the
central processing unit A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, an ...
(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ó Fernando José "Corby" Corbató (July 1, 1926 – July 12, 2019) was a prominent American computer scientist, notable as a pioneer in the development of time-sharing operating systems. Career Corbató was born on July 1, 1926 in Oakland, Califo ...
(1962). For this accomplishment, the
Association for Computing Machinery The Association for Computing Machinery (ACM) is a US-based international learned society for computing. It was founded in 1947 and is the world's largest scientific and educational computing society. The ACM is a non-profit professional member ...
awarded Corbató the
Turing Award The ACM A. M. Turing Award is an annual prize given by the Association for Computing Machinery (ACM) for contributions of lasting and major technical importance to computer science. It is generally recognized as the highest distinction in compu ...
.


Process scheduling

Whereas the
multilevel queue Multi-level queueing, used at least since the late 1950s/early 1960s, is a queue with a predefined number of levels. Items get assigned to a particular level at insert (using some predefined algorithm), and thus cannot be moved to another level (un ...
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 Starvation is a severe deficiency in caloric energy intake, below the level needed to maintain an organism's life. It is the most extreme form of malnutrition. In humans, prolonged starvation can cause permanent organ damage and eventually, dea ...
, it will be
aged Ageing ( BE) or aging ( AE) is the process of becoming older. The term refers mainly to humans, many other animals, and fungi, whereas for example, bacteria, perennial plants and some simple animals are potentially biologically immortal. In ...
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 which 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 Round-robin may refer to: Computing * Round-robin DNS, a technique for dealing with redundant Internet Protocol service hosts * Round-robin networks, communications networks made up of radio nodes organized in a mesh topology * Round-robin schedu ...
fashion until they complete and leave the system. Processes in the base level queue can also be scheduled on a
first come first served Queueing theory is the mathematical study of waiting lines, or queues. A queueing model is constructed so that queue lengths and waiting time can be predicted. Queueing theory is generally considered a branch of operations research because the ...
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. Meanwhile, if a process comes into any of the higher level queues, it will preempt a process in the lower level queue. Also, 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.


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.


External links


Multilevel Feedback Queue Schedulers — Solaris 2.6 Time-Sharing

Processor Sharing Queueing Models of Mixed Scheduling Disciplines for Time Shared System


See also

*
Lottery scheduling Lottery scheduling is a probabilistic scheduling algorithm for processes in an operating system. Processes are each assigned some number of lottery tickets, and the scheduler draws a random ticket to select the next process. The distribution of ti ...
*
Fair-share scheduling Fair-share scheduling is a scheduling algorithm for computer operating systems in which the CPU usage is equally distributed among system users or groups, as opposed to equal distribution of resources among processes. One common method of logical ...
*
Round-robin scheduling Round-robin (RR) is one of the algorithms employed by process and network schedulers in computing.Guowang Miao, Jens Zander, Ki Won Sung, and Ben Slimane, Fundamentals of Mobile Data Networks, Cambridge University Press, , 2016. As the term is ...


References

{{Processor scheduling Processor scheduling algorithms