Consider a disk queue with requests for I/O to blocks on cylinders 47, 38,…

2016

Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is ___________.

Attempted by 92 students.

Show answer & explanation

Correct answer: 346

Key idea: Use the C-LOOK algorithm: service requests in increasing cylinder order while moving towards larger cylinder numbers, then jump to the smallest pending request and continue in increasing order.

Initial head position: 63. Request cylinders: 47, 38, 121, 191, 87, 11, 92, 10.

Requests greater than 63 (serve first, in increasing order): 87, 92, 121, 191.

Requests less than or equal to 63 (served after the wrap, in increasing order): 10, 11, 38, 47.

  • Move from 63 to 87: 24

  • Move from 87 to 92: 5

  • Move from 92 to 121: 29

  • Move from 121 to 191: 70

  • Wrap (jump) from 191 to 10: 181

  • Move from 10 to 11: 1

  • Move from 11 to 38: 27

  • Move from 38 to 47: 9

Sum of movements: 24 + 5 + 29 + 70 + 181 + 1 + 27 + 9 = 346 cylinders.

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

Explore the full course: Gate Guidance By Sanchit Sir