C-LOOK (Circular LOOK)


C-LOOK takes the advantages of both the disk scheduling C-SCAN, and Look disk scheduling. In C-look scheduling, the disk arm moves and service each request till the head reaches its highest request, and after that, the disk arm jumps to the lowest cylinder without servicing any request, and the disk arm moves further and service those requests which are remaining.


Advantages:


Disadvantages:

Example:

Steps to Implement Algorithm:

  1. Let Request array represents an array storing indexes of the tracks that have been requested in ascending order of their time of arrival and head is the position of the disk head.
  2. The initial direction in which the head is moving is given and it services in the same direction.
  3. The head services all the requests one by one in the direction it is moving.
  4. The head continues to move in the same direction until all the requests in this direction have been serviced.
  5. While moving in this direction, calculate the absolute distance of the tracks from the head.
  6. Increment the total seek count with this distance.
  7. Currently serviced track position now becomes the new head position.
  8. Go to step 5 until we reach at last request in this direction.
  9. If we reach the last request in the current direction then reverse the direction and move the head in this direction until we reach the last request that is needed to be serviced in this direction without servicing the intermediate requests.
  10. Reverse the direction and go to step 3 until all the requests have not been serviced

Time Complexity: O ( N * logN )   Auxiliary Space: O ( N )

Simulate