Operating System | Multilevel Queue Scheduling | Multilevel Feedback Queue Scheduling - cook the code

Tuesday, 9 January 2018

Operating System | Multilevel Queue Scheduling | Multilevel Feedback Queue Scheduling

Multilevel Queue Scheduling

Multiple-level queues are not an independent scheduling algorithm. They make use of other existing algorithms to group and schedule jobs.

A multi-level queue scheduling algorithm partitions the ready queue into several separate queues. 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, CPU-bound jobs can be scheduled in one queue and all I/O-bound jobs in another queue.

After the completion of all the processes from the top level ready queue(High priority),then the further level ready queue is scheduled.

In this algorithm lower level process may suffer from starvation (the indefinite waiting of the process) problem. 


Let us consider an example of a multilevel queue-scheduling algorithm with five queues:
  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 will be preempted.
Multi Level Scheduling Queues

Multilevel Feedback Queue Scheduling

In a multilevel queue-scheduling algorithm, processes are permanently assigned to a queue on entry to the system. Processes do not move between queues.This setup has the advantage that high priority process is get executed first but has a disadvantage of starvation problem.

Multilevel feedback queue scheduling, however, allows a process to move between queues. The idea is to separate processes with different CPU-burst characteristics. 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. This method solve the problem of starvation.


Multi Level Feedback Scheduling Queues
An example of a multilevel feedback queue can be seen in the below figure.

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.
  • 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. Unfortunately, it also requires some means of selecting values for all the parameters to define the best scheduler. Although a multilevel feedback queue is the most general scheme, it is also the most complex.

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.

No comments:

Post a Comment