Consider a disk system with 100 cylinders. The requests to access the…
2009
Consider a disk system with 100 cylinders. The requests to access the cylinders occur in the following sequence: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1 ms to move from one cylinder to an adjacent one and Shortest Seek Time First (SSTF) policy is used?
- A.
95 ms
- B.
119 ms
- C.
233 ms
- D.
276 ms
Attempted by 39 students.
Show answer & explanation
Correct answer: B
To solve this using Shortest Seek Time First (SSTF), we start at cylinder 50 and select the nearest request at each step. The available requests are: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20.
1. Start at 50. Nearest is 34 (distance |50-34| = 16). 2. From 34, nearest is 20 (distance |34-20| = 14). 3. From 20, nearest is 19 (distance |20-19| = 1). 4. From 19, nearest is 15 (distance |19-15| = 4). 5. From 15, nearest is 10 (distance |15-10| = 5). 6. From 10, nearest is 7 (distance |10-7| = 3). 7. From 7, nearest is 6 (distance |7-6| = 1). 8. From 6, nearest is 4 (distance |6-4| = 2). 9. From 4, nearest is 2 (distance |4-2| = 2). 10. From 2, only 73 remains (distance |2-73| = 71).
Total seek distance = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119 cylinders. Since it takes 1 ms per cylinder, the total time required is 119 ms.
A video solution is available for this question — log in and enroll to watch it.