13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

42 Time Management Chapter 2middle-length processes, where HPRN has an intermediate penalty ratio; and for verylong processes, where SPN becomes worse than FCFS but where HPRN is still in themiddle.However, HPRN has some disadvantages. First, it is not preemptive, so it cannotbeat RR or PSPN for short processes. A short process that unluckily arrives just after along process has started executing will still have to wait a very long time. Second, it isgenerally not as good as SPN (at least in our simulation), which uses the same techniques:knowledge of process length without preemption. Third, HPRN is more expensiveto implement, since the penalty ratio must be calculated for every waiting processwhenever a running process completes.2.6 Multiple-level feedback (FB)The multiple-level feedback method splits the ready list into a number of queues: queue0, queue 1, queue 2, and so on. Lower-numbered queues have higher priority. When thecurrent process is interrupted at the end of its quantum, a new process is selected fromthe front of the lowest-numbered queue that has any processes. After a process has useda certain number of quanta in its queue, it is placed at the end of the next-highernumberedqueue. (The word ‘‘feedback’’ in the name of this method refers to the factthat processes can move from one queue to another.) In Figure 2.10, a process is allowedonly one quantum in its queue before being bumped to the next one. The statistics forour process set are as follows.3C6 12E201B1807919AD05101520ABACBCABBDDDEEEDEBDE112 1 2 2 3 3 4 1 2 3 1 2 344555queueFigure 2.10 FB Schedule

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!