SCAN



Introduction

The SCAN disk scheduling algorithm is another type of disk scheduling algorithm. In this algorithm, we move the disk arm into a specific direction (direction can be moved towards large value or the smallest value). Each request is addressed that comes in its path, and when it comes into the end of the disk, then the disk arm will move reverse, and all the requests are addressed that are arriving in its path. Scan disk scheduling algorithm is also called an elevator algorithm because its working is like an elevator.


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.


Disdvantages

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.


Example

Consider a disk containing 200 tracks (0-199) and the request queue includes the track number 93, 176, 42, 148, 27, 14, 180, respectively. The current position of read//write head is 55, and direction is towards the larger value. Calculate the total number of cylinders moved by the head using SCAN disk scheduling.


As mentioned in the following example, the disk contains 200 tracks. So, we take a track line between 0 to 199. The current position of the read/write head is 55. So, we start at 55, then move the read/write head. When all the requests are addressed, then we calculate a total number of cylinders moved by the head.


scan img

Total Number of cylinders moved by head = (199-55) + (199-14) = 329