All mock tests are FREE till 31 December — register to save your progress

A disk head is currently at cylinder 50. The pending requests, in the order they arrived, are for cylinders: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. Using the Shortest-Seek-Time-First (SSTF) disk scheduling policy, and given that it takes 1 ms to move the head between two adjacent cylinders, what is the total time needed to service all the requests?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. 119 ms

Explanation

SSTF always services whichever pending request is nearest to the head's current position. From 50 the service order works out to 34 (seek 16), 20 (14), 19 (1), 15 (4), 10 (5), 7 (3), 6 (1), 4 (2), 2 (2), and finally 73, which is the only request left and requires a long jump of 71 cylinders. Summing the individual seek distances — 16+14+1+4+5+3+1+2+2+71 — gives a total head movement of 119 cylinders, i.e. 119 ms at 1 ms/cylinder, option (i). The large final seek out to 73 (left for last because every nearer request kept winning) is a classic illustration of SSTF's tendency to starve outlying requests.

More Database Management Systems questions