DISK SCHEDULING

Experiment Number 6 : C-LOOK



Algorithm

• Step 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.

• Step 2: The initial direction in which the head is moving is given and its services in the same direction.

• Step 3: The head services all the requests one by one in the direction it is moving.

• Step 4: The head continues to move in the same direction until all the requests in this direction have been serviced.

• Step 5: While moving in this direction, calculate the absolute distance of the tracks from the head.

• Step 6: Increment the total seek count with this distance.

• Step 7: Currently serviced track position now becomes the new head position.

• Step 8: Go to step 5 until we reach the last request in this direction.

• Step 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.

• Step 10: Reverse the direction and go to step 3 until all the requests have not been serviced.