In Shortest-Seek-Time-First (SSTF) scheduling, the request closest to the current head position is served next.
Initial head position: 100
Request queue: {30,85,90,100,105,110,135,145}
Step-by-step servicing:
At head position 100, there is a request at cylinder 100 (distance =∣100−100∣=0). Cylinder 100 is serviced first.
Head is at 100. Remaining requests: {30,85,90,105,110,135,145}.
Distance to 105=5
Distance to 90=10
Distance to 110=10
Distance to 85=15
Nearest is 105. Cylinder 105 is serviced second.
Head is at 105. Remaining requests: {30,85,90,110,135,145}.
Distance to 110=5
Distance to 90=15
Distance to 85=20
Nearest is 110. Cylinder 110 is serviced third.
Head is at 110. Remaining requests: {30,85,90,135,145}.
Distance to 90=20
Distance to 135=25
Distance to 85=25
Nearest is 90. Cylinder 90 is serviced fourth.
Thus, cylinder 90 is serviced after servicing 3 requests (namely cylinders 100, 105, and 110).