Open In App

Difference between SCAN and LOOK Disk scheduling algorithms

Improve
Improve
Like Article
Like
Save
Share
Report

SCAN disk scheduling algorithm: In SCAN disk scheduling algorithm, head starts from one end of the disk and moves towards the other end, servicing requests 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 an elevator and hence also known as the elevator algorithm. As a result, the requests at the mid range are serviced more and those arriving behind the disk arm will have to wait. LOOK disk scheduling algorithm: The LOOK algorithm services request similarly as SCAN algorithm meanwhile it also “looks” ahead as if there are more tracks that are needed to be serviced in the same direction. If there are no pending requests in the moving direction the head reverses the direction and start servicing requests in the opposite direction. The main reason behind the better performance of LOOK algorithm in comparison to SCAN is because in this algorithm the head is not allowed to move till the end of the disk. Difference between SCAN and LOOK Disk scheduling algorithms:

SR. NO. SCAN SCHEDULING LOOK SCHEDULING
1. This algorithm scans all the cylinder of the disk back and forth. This is the improved version of SCAN algorithm.
2. Head starts from one end of the disc and move towards the other processing all the requests coming in between. After it reaches the end, The head then reverses it’s direction and move towards the start again processing all the requests arising in between, the same process repeats itself. Head starts from the first request and moves to the other end processing all the requests arising in between. Once it reaches the last requests at the other end, head reversing it’s direction and returns to the first request processing all the requests in between.
3. It scans all the cylinders from one end to other even if there are no requests at the end. It scans all the cylinders from first request at the start point to the last request.
4. It causes the head to move till the last section of the disc even when there are no requests. It does not cause the head to move till the last section of the disc when there is no requests.
5. Less efficient. Compared to SCAN, LOOK is more efficient.
6. Assume we are going inwards (i.e.towards 0). Reduce variance compared to SCAN.

SCAN and LOOK are both disk scheduling algorithms that work by servicing requests in a predictable order. However, there are some key differences between the two algorithms:

Behavior at endpoint:
The SCAN algorithm always moves the head to the endpoint of the disk and then immediately reverses direction, while the LOOK algorithm only goes as far as the last request in the current direction and then reverses direction.

Servicing Order:
SCAN algorithm services all requests in its path, while LOOK algorithm only services requests in the current direction. It avoids servicing requests that are in the opposite direction, which can save some time.

Handling of empty disk areas:
The SCAN algorithm may waste time moving the head back and forth across empty regions of the disk, while the LOOK algorithm skips over empty regions, thereby reducing the total amount of time spent seeking.

Efficiency:
The LOOK algorithm is generally considered to be more efficient than the SCAN algorithm because it avoids servicing empty regions and can more quickly service requests that are close to the head.

In summary, the main difference between SCAN and LOOK disk scheduling algorithms is that the SCAN algorithm always moves the head to the endpoint of the disk and reverses direction, while the LOOK algorithm reverses direction only when it reaches the last request in the current direction. Additionally, LOOK is generally considered more efficient than SCAN, especially when there are long stretches of empty disk space.


Last Updated : 24 Apr, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads