13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Policies 39q = 4Process Arrival Service Finish T M Pname time required time A 0 3 3 3 0 1.0 B 1 5 10 9 4 1.8 C 3 2 9 6 4 3.0 D 9 5 19 10 5 2.0 E 12 5 20 8 3 1.6Mean 7.2 3.2 1.88Figures 2.4 and 2.6 display RR with a quantum of 0.1. The shortest 10 percent ofall processes can be serviced in one quantum. All other processes suffer a penalty ratio ofapproximately 5. RR therefore penalizes all processes about the same, unlike FCFS,which causes all processes to miss the same amount of time. Figure 2.6 shows that themissed time is very small (on the order of one quantum) for very short processes and thatthe missed time rises steadily as processes become longer.Under PS, which is a limiting case of RR, we have the following service measures:T (t ) = t P () = 11−ρ 1−ρThe second formula agrees with our observation that the penalty ratio has the value 5,independent of t .2.3 Shortest process next (SPN)We have seen that RR improves the response ratio for short processes but that it requirespreemption to do so. The SPN method is an attempt to have the same effect withoutpreemption. Instead, it requires a different ingredient: explicit information about theservice-time requirements for each process. When a process must be selected from theready list to execute next, the one with the shortest service-time requirement is chosen.How are these service times discovered? It obviously won’t do to execute the process,see how long it takes, and then schedule it according to this knowledge. One alternativeis to have the user characterize the process before it starts. For example, a processcould be characterized as transput-bound or compute-bound. A highly interactive process,such as a text editor, is transput-bound. A long simulation that uses internally generatedrandom data is compute-bound. More precisely, the average service time needed(averaged over each entry into the short-term scheduler) could be specified. It seems anunreasonable burden to have the user characterize each process. Processes coulddescribe themselves (in their load image, discussed in Chapter 3), but that descriptionwould be at best a guess. Besides, processes often go through phases, some of whichrequire more computation between transput events and some of which require less.

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

Saved successfully!

Ooh no, something went wrong!