📜  SCAN 和 LOOK 磁盘调度算法的区别

📅  最后修改于: 2021-09-13 03:07:57             🧑  作者: Mango

SCAN磁盘调度算法:
在 SCAN 磁盘调度算法中,磁头从磁盘的一端开始向另一端移动,服务于其间的请求并到达另一端。然后磁头的方向被反转,这个过程继续,因为磁头不断来回扫描以访问磁盘。因此,该算法作为电梯工作,因此也称为电梯算法。

结果,中间范围的请求得到更多服务,到达磁盘臂后面的请求将不得不等待。

LOOK磁盘调度算法:
LOOK 算法服务请求类似于 SCAN 算法,同时它也“向前看”,好像有更多的轨道需要在同一个方向上服务。如果在移动方向上没有未决请求,则头部反转方向并开始为相反方向的请求提供服务。

与 SCAN 相比,LOOK 算法性能更好的主要原因是因为在该算法中,磁头不允许移动到磁盘末尾。

SCAN 和 LOOK 磁盘调度算法的区别:

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.