SCAN

Downward Arrow

About

SCAN

In SCAN disk scheduling algorithm, head starts from one end of the disk moves towards the other end, servicing request in between one by one and reach the other end. Then the direction of the head is reversed and the process continues as head continuously scan back and forth to access the disk.

So, this algorithm works as and elevator and hence also known as the elevator algorithm. As a result, the requests at the midrange are serviced more and those arriving behind the disk arm will have to wait.


Advantages

  1. In SCAN disk scheduling, there is a low variance of response time.

  2. In this algorithm, throughput is high.

  3. Response time is average.

  4. In SCAN disk scheduling, there is no starvation.

Disadvantages

  1. SCAN disk scheduling algorithm takes long waiting time for the cylinders, just visited by the head.

  2. In 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. Request array represents an array storing indexes of tracks that have been requested in ascending order of their time of arrival. 'head' is the position of disk head.

  2. Let direction represents whether the head is moving towards left or right.

  3. In the direction in which head is moving service all tracks one by one.

  4. Calculate the absolute distance of the track from the head.

  5. Increment the total seek count with this distance.

  6. Currently serviced track position now becomes the new head postion.

  7. Go to step 3 until we reach at one end of the disk.

  8. If we reach at the end of the disk reverse the direction and go to step 2 until all the tracks in request array have not been serviced.

Implementation

CHART WILL APPEAR HERE