Consider a disk queue with requests for input/output to blocks on cylinders…

2013

Consider a disk queue with requests for input/output to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, and 67 in that order. Assume that the disk has cylinders numbered 0 to 199, and the disk head is initially positioned at cylinder 53 and moving towards cylinder number 0. The total number of head movements using Shortest Seek Time First (SSTF) and SCAN algorithms are respectively:

  1. A.

    236 and 252 cylinders

  2. B.

    640 and 236 cylinders

  3. C.

    235 and 640 cylinders

  4. D.

    235 and 252 cylinders

Attempted by 132 students.

Show answer & explanation

Correct answer: A

SSTF calculation:

  • SSTF always chooses the nearest pending request.

  • Order: 53 -> 65 -> 67 -> 37 -> 14 -> 98 -> 122 -> 124 -> 183

  • Movement = 12 + 2 + 30 + 23 + 84 + 24 + 2 + 59 = 236 cylinders

SCAN calculation:

  • The head initially moves toward cylinder 0.

  • Under standard SCAN, it goes to 0, reverses, and continues to the far end of the disk.

  • With cylinders numbered 0 to 199, movement = (53 - 0) + (199 - 0) = 252 cylinders

Final answer: 236 and 252 cylinders.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor