Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time, the…
2014
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time, the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.
Attempted by 113 students.
Show answer & explanation
Correct answer: 3
Given: Cylinders 0–200; current head position 100; request queue: 30, 85, 90, 100, 105, 110, 135, 145
Key idea: Shortest-Seek Time First chooses the pending request with the smallest absolute distance from the current head at each step.
Step 1 — Current head: 100. Pending requests: 30, 85, 90, 100, 105, 110, 135, 145. Distances: 70, 15, 10, 0, 5, 10, 35, 45. Request chosen: 100 (distance 0). New head: 100.
Step 2 — Current head: 100. Pending requests: 30, 85, 90, 105, 110, 135, 145. Distances: 70, 15, 10, 5, 10, 35, 45. Request chosen: 105 (distance 5). New head: 105.
Step 3 — Current head: 105. Pending requests: 30, 85, 90, 110, 135, 145. Distances: 75, 20, 15, 5, 30, 40. Request chosen: 110 (distance 5). New head: 110.
Step 4 — Current head: 110. Pending requests: 30, 85, 90, 135, 145. Distances: 80, 25, 20, 25, 35. Request chosen: 90 (distance 20).
Requests serviced prior to cylinder 90: 100 → 105 → 110
Number of requests before cylinder 90 is serviced: 3
Answer: 3
A video solution is available for this question — log in and enroll to watch it.