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.

40 Time Management Chapter 2Instead, the short-term scheduler can accumulate service statistics for each processevery time it departs. Say a given process p used s seconds of time during its mostrecent stay in the short-term ready list. Then the exponential average e p can be updatedthis way:e p ′ := 0.9 e p + 0.1 sThe number 0.9 is called a ‘‘smoothing factor,’’ and may be set to a higher number (like0.99) to make the estimate less responsive to change, or to a lower number (like 0.7) tomake the estimate more responsive to change. The initial estimate, for the first time theprocess arrives, can be the average service time for all processes.To demonstrate the SPN method, we will assume that the scheduler has completeand accurate knowledge of the service requirement of each process. Our sample set ofprocesses is serviced as shown in Figure 2.9.3 5C1101220BE0 3915AD0 5 10 15 20A C B D EFigure 2.9 SPN ScheduleHere are the statistics when these processes are scheduled under SPN:Process Arrival Service Start FinishT M Pname time required time time A 0 3 0 3 3 0 1.0 B 1 5 5 10 9 4 1.8 C 3 2 3 5 2 0 1.0 D 9 5 10 15 6 1 1.2 E 12 5 15 20 8 3 1.6Mean 5.6 1.6 1.32The response time under SPN is particularly good for short processes, as you mightexpect. In contrast, long processes may wait a long time indeed, especially if ρapproaches 1. Overall, T () and M () are lower under SPN than any method that does notuse a time estimate. Although analytic results are hard to derive, Figures 2.4 and 2.6, our

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

Saved successfully!

Ooh no, something went wrong!