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.

Goals, measures, and assumptions 29It is important to give special service to interactive processes, because otherwisethe user might get very frustrated. A user interacting with a process would ideally like tosee an immediate response to every command. Failing that, ‘‘consistent’’ response isbetter than good average response. Response that always takes about 2 seconds is betterthan response that averages about 1 second but occasionally takes 10 or only 0.5. Formally,a low variance of response time is better than a low mean.Transput-bound processes must also be given special treatment. Here the mean ismore important than the variance. Let’s take as an example a process that needs to computefor 1 millisecond and then waits 20 milliseconds for transput. This sequence repeats1000 times. In total, the process needs 1 second of computation and 20 seconds of transput,a total of 21 seconds. But if it is delayed half a second every time it becomes ready,it will take 521 seconds. Even if some delays are longer, a small average delay will payoff handsomely. A 1-millisecond average delay will allow the process to finish in 22seconds.1 GOALS, MEASURES, AND ASSUMPTIONSAs mentioned earlier, there are several competing goals that scheduling policies aim tofulfill. One is ‘‘good throughput’’ — getting lots of work done. For short-term scheduling,good throughput means minimizing the number of process switches, because eachone costs some time during which no productive work is accomplished.The other goal is ‘‘good service.’’ We can be more precise by defining threerelated measures that tell how well we are treating a particular process. Say a process prequires t time in execution before it can leave the ready list because it will either finishor will need to wait for something. Then we define the following service measures forthat process.response time T : time that p is present; finish time − arrival timemissed time M : T − tpenalty ratio P : T/tresponse ratio R : t/TThe response time T counts not only how long p needs, but also how long it sits in theready list while other processes are run. It might wait its turn for a while. Once it starts,we might be nasty and stop it after some time, letting it continue later. The entire timethat process p is on the ready list (until it leaves our view to go to other lists) is chargedto T . The process is not visible to the short-term scheduler while it is waiting for transputor other resources, and therefore such wait time is not included in T .The missed time M is the same thing, except we don’t count the amount of timeduring which p is actually running. M measures the amount of time during which pwould like to run but is prevented.The response ratio R and the penalty ratio P are inverses of each other. Rrepresents the fraction of the time that p is receiving service. If the response ratio R is 1,then p never sits in the ready list while some other process runs. If the response ratio Ris 1/100, then P = 100 and the process seems to be taking 100 times as long as it should;

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

Saved successfully!

Ooh no, something went wrong!