Question
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 _____.
Official answer and solution
- Official answer
- 346
- From
- Official GATE 2016 answer key
Solution
Trace the head movements in C-LOOK disk scheduling for the given request sequence and starting position.
Given requests: 47, 38, 121, 191, 87, 11, 92, 10.
Arranged in sorted order: .
Initial head position: .
Current direction: Towards larger cylinder numbers.
In C-LOOK (Circular LOOK) scheduling:
- The head services requests in the current direction up to the last request in that direction.
- It then jumps directly to the lowest requested cylinder at the other end without servicing requests during the jump.
- Finally, it services remaining requests moving in the original direction.
Path trace:
- From initial position , move towards larger cylinders to service :
- From the highest cylinder requested (), jump to the lowest requested cylinder ():
- From cylinder , move upwards to service the remaining requests :
Calculate total head movement:
346
Treating C-LOOK like C-SCAN by moving all the way to the boundary cylinder 199 and wrapping to cylinder 0, which yields .
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 1
- Question
- 58 of 65, printed as CS Q.48
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.