Skip to content
Official PYQ · 2009

GATE CS 2009 Q31 — I/O Scheduling

Explain with AI

Consider a disk system with 100100 cylinders. The requests to access the cylinders occur in following sequence:

4,34,10,7,19,73,2,15,6,204, 34, 10, 7, 19, 73, 2, 15, 6, 20

Assuming that the head is currently at cylinder 5050, what is the time taken to satisfy all requests if it takes 1  ms1\;\text{ms} to move from one cylinder to adjacent one and shortest seek time first policy is used?

Choose one option
View worked solution

Answer: B

In the Shortest Seek Time First (SSTF) disk scheduling algorithm, the request closest to the current head position is serviced next.

The set of pending requests is: {2, 4, 6, 7, 10, 15, 19, 20, 34, 73}

Starting from the initial head position at 50, the step-by-step head movement is as follows:

  1. 50 → 34: Seek distance = ∣50−34∣=16|50 - 34| = 16
  2. 34 → 20: Seek distance = ∣34−20∣=14|34 - 20| = 14
  3. 20 → 19: Seek distance = ∣20−19∣=1|20 - 19| = 1
  4. 19 → 15: Seek distance = ∣19−15∣=4|19 - 15| = 4
  5. 15 → 10: Seek distance = ∣15−10∣=5|15 - 10| = 5
  6. 10 → 7: Seek distance = ∣10−7∣=3|10 - 7| = 3
  7. 7 → 6: Seek distance = ∣7−6∣=1|7 - 6| = 1
  8. 6 → 4: Seek distance = ∣6−4∣=2|6 - 4| = 2
  9. 4 → 2: Seek distance = ∣4−2∣=2|4 - 2| = 2
  10. 2 → 73: Seek distance = ∣73−2∣=71|73 - 2| = 71

Now, we sum the individual seek distances to find the total head movement:

Total Seek Distance=16+14+1+4+5+3+1+2+2+71=119 cylinders\text{Total Seek Distance} = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119 \text{ cylinders}

Given that it takes 1 ms1\text{ ms} to move across one cylinder, the total time taken is:

Total Time=119×1 ms=119 ms\text{Total Time} = 119 \times 1\text{ ms} = 119\text{ ms}

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

Published
Report a correction
Keep exploringMore I/O Scheduling questions