Reference no: EM132747964
Computer Lab: Multi-Level Feedback Queue simulation
In a time-sharing computer system many users share the computer simultaneously. such a system typically has a single CPU (the processor) and one main memory. Several user programs are placed in main storage at once (usually in a waiting queue(s)) and the processor is switched rapidly between the jobs according to some job scheduling policy.
Jobs (processes) are usually given a limited amount of CPU time called a time slice or quantum. If a process does not complete before its CPU time expires, the CPU is preempted and given to the next waiting process. Eventually each process will acquire the CPU for a long enough period of time sufficient complete its required job.
In this lab you will write a Java program that will simulate an operating system's job scheduling policy to determine which process will be assigned the CPU when it becomes available. We will utilize a system of queues to simulate a sophisticated job scheduling mechanism, the multi-level feedback queue (MFQ).
A new process enters the queuing network at the rear of the top queue. It moves through that queue FIFO until it moves to the front of the queue and gets the CPU. If the job completes or relinquishes the CPU to wait for I/O completion or completion of some other event, the job leaves the queuing network. If the quantum expires before the process voluntarily relinquishes the CPU, the process is removed from the CPU and placed at the rear of the next lower-level queue (preemption). The process is next serviced when it reaches the front of that queue if the first queue is empty. As long as the process continues using the full quantum provided at each level, it continues to move to the rear of the next lower queue. Usually there is some bottom-level queue through that the process
circulates round robin until it completes.
In the multi-level feedback scheme, the quantum given to processes as they move to each lower level queue becomes larger. Thus, the longer a process has been in the queuing network, the larger quantum it is assigned each time it gets the CPU. But it may not get the CPU very often because processes in the higher queue are given higher priority. A process in a given queue cannot run unless all higher-level queues are empty. A process can also be preempted by a new Process entering the queuing system.
Attachment:- Multi-Level Feedback Queue simulation.rar