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 43Process Arrival Service Finish T M Pname time required time A 0 3 7 7 4 2.3 B 1 5 18 17 12 3.4 C 3 2 6 3 1 1.5 D 9 5 19 10 5 2.0 E 12 5 20 8 3 1.6Mean 9.0 5.0 2.16Short processes have priority over long ones, since they finish while still in the firstqueue, whereas long processes eventually migrate to low priority queues. T () is the sameas for RR, so since short processes do better than under RR, long processes must do morepoorly. This prediction is borne out by the results in Figures 2.4 and 2.6. FB is betterthan RR for about 80 percent of all processes but worse for the longest 20 percent.The FB method has several variations.(1) Let the quantum size depend on the queue. A queue numbered n could have aquantum of length 2 n q , where q is the ‘‘basic quantum’’ size. Therefore, thequeues have quanta of sizes q ,2q ,4q ,8q , and so on. The quantum given to anyprocess is based on the queue it is taken from. A process that needs a long timesuffers process switches after times q ,3q ,7q ,15q , and so on. The total numberof process switches is therefore log(t (p ) /q) instead of t (p ) /q, which is thenumber needed by RR. Therefore, this method reduces process switch overheadwhile still behaving much like RR.The quantum length could be calculated by slower-growing functions, such asn . q . Such functions keep the quantum size within reasonable bounds while stillreducing the total number of process switches needed for long processes.Figure 2.11 shows how our sample processes are treated with exponentiallygrowing quanta.

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

Saved successfully!

Ooh no, something went wrong!