C-SCAN

Downward Arrow

About

C SCAN

Circular SCAN (C-SCAN) scheduling algorithm is a modified version of SCAN disk scheduling algorithm that deals with the inefficiency of SCAN algorithm by servicing the requests more uniformly.

Like SCAN (Elevator Algorithm) C-SCAN moves the head from one end servicing all the requests to the other end. However, as soon as the head reaches the other end, it immediately returns to the beginning of the disk without servicing any requests on the return trip and starts servicing again once it reaches the beginning.

Advantages

  1. C-SCAN offers better uniform waiting time.

  2. It offers a better response time.

Disadvantages

  1. In C-SCAN disk scheduling, there are more seek movements as compared to SCAN disk scheduling.

  2. In C-SCAN disk scheduling, we have to move the disk head to the end of the disk even when we don’t have any request to service.

Algorithm

  1. A request array contains the indexes of the tracks that have been requested in ascending order of time interval. The position of the read/ write head is 'HEAD'.

  2. The head services only in the right direction from 0 to size of the disk.

  3. While moving in the left direction do not service any of the tracks.

  4. When you reach at the beginning (left end) reverse the direction.

  5. While moving in right direction it services all tracks one by one.

  6. While moving in right direction calculate the absolute distance of the track from the head.

  7. Increment the total seek count with this distance.

  8. Currently serviced track position now becomes the new head position.

  9. Go to step 6 until we reach at right end of the disk.

  10. If you reach at the right end of the disk reverse the direction and go to step 3 until all tracks in request array have not been serviced.

Implementation

CHART WILL APPEAR HERE