Skip to content
Official PYQ · 2014

GATE CS 2014 Set 1 Q19 — I/O Scheduling

Explain with AI
Suppose a disk has 201201 cylinders, numbered from 00 to 200200. At some time the disk arm is at cylinder 100100, and there is a queue of disk access requests for cylinders 30,85,90,100,105,110,13530, 85, 90, 100, 105, 110, 135 and 145145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 9090 is serviced after servicing ____________ number of requests.
View worked solution

Answer: 3

Under the Shortest-Seek Time First (SSTF) scheduling algorithm, the disk arm always services the pending request closest to its current position.

The initial position of the disk arm is 100, and the queue of pending requests is: {30, 85, 90, 100, 105, 110, 135, 145}.

We trace the servicing order step-by-step:

  1. At cylinder 100: The request at 100 is at distance 00.
    ightarrowightarrow 1st request serviced: 100 (Current position: 100)
  2. At cylinder 100: The closest remaining requests are 105 (distance 55) and 90 (distance 1010).
    ightarrowightarrow 2nd request serviced: 105 (Current position: 105)
  3. At cylinder 105: The closest remaining requests are 110 (distance 55) and 90 (distance 1515).
    ightarrowightarrow 3rd request serviced: 110 (Current position: 110)
  4. At cylinder 110: The closest remaining requests are 90 (distance 2020) and 135 (distance 2525).
    ightarrowightarrow 4th request serviced: 90 (Current position: 90)

Thus, the request for cylinder 90 is serviced after servicing exactly 3 requests (namely 100, 105, and 110).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore I/O Scheduling questions