C-SCAN stands for Circular-SCAN. C-SCAN is an enhanced version of SCAN disk scheduling. In the C-SCAN disk scheduling algorithm, the disk head starts to move at one end of the disk and moves towards the other end and service the requests that come in its path and reach another end. After doing this, the direction of the head is reversed. The head reaches the first end without satisfying any request and then it goes back and services the requests which are remaining.
Algorithm:
Let Request array represents an array storing indexes of tracks that have been requested. ‘head’ is the position of disk head.
The head services only in the right direction from 0 to size of the disk.
While moving in the left direction do not service any of the tracks.
When we reach at the beginning(left end) reverse the direction.
While moving in right direction it services all tracks one by one.
While moving in right direction calculate the absolute distance of the track from the head.
Increment the total seek count with this distance.
Currently serviced track position now becomes the new head position.
Go to step 6 until we reach at right end of the disk.
If we 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.
Video:
Advantages of C-SCAN Disk scheduling Algorithm:
The advantages of C-SCAN disk scheduling algorithm are:
C-SCAN offers better uniform waiting time.
It offers a better response time.
Disadvantages of C-SCAN Disk Scheduling Algorithm:
The disadvantages of C-SCAN disk scheduling algorithm are:
In C-SCAN disk scheduling, there are more seek movements as compared to SCAN disk scheduling.
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.