操作系统磁盘调度算法_各种磁盘调度算法| 操作系统

本文对比了六种磁盘调度算法:FCFS、SSTF、SCAN、CSCAN、LOOK和CLOOK。FCFS简单但不可抢占;SSTF减少响应时间但可能导致饥饿;SCAN和CSCAN提供高吞吐量但可能有长等待时间;LOOK和CLOOK避免了不必要的延迟。这些算法在操作系统中用于优化磁盘操作的效率。
摘要由CSDN通过智能技术生成

操作系统磁盘调度算法

Let us compare various disk scheduling algorithms:

让我们比较一下各种磁盘调度算法

1. FCFS (1. FCFS)

In FCFS, the requests are addressed in the sequence they come in the disk queue.

在FCFS中,请求按它们进入磁盘队列的顺序进行寻址。

Pros:

优点:

  • Simple

    简单

  • Not complex

    不复杂

  • Easy to implement

    易于实施

  • No starvation

    没有饥饿

  • Low overhead

    低开销

  • No indefinite delay

    没有无限的延迟

  • Low overhead

    低开销

Cons:

缺点:

  • No preemption possible

    不可抢占

  • Low throughput

    产量低

  • Best services may not be delivered

    最好的服务可能无法提供

2. SSTF (2. SSTF)

In SSTF (Shortest Seek Time First), execution of requests having the shortest seek time takes place first. So, in advance, the seek time of every request is calculated in the queue. They are then scheduled according to their seek time as it is calculated. As a result, the request closer to the disk arm will be executed first. SSTF is certainly better over FCFS because it reduces the average response time and improves the throughput of the system.

在SSTF(最短查找时间优先)中,最先执行查找时间最短的请求。 因此,预先在队列中计算每个请求的查找时间。 然后根据计算出的寻道时间对它们进行调度。 结果,将首先执行更靠近磁盘臂的请求。 SSTF当然比FCFS更好,因为它减少了平均响应时间并提高了系统吞吐量。

Pros:

优点:

  • The average time taken for response is reduced

    减少了平均响应时间

  • Many processes can be processed

    可以处理许多过程

  • An increase in throughput

    吞吐量增加

Cons:

缺点:

  • Starvation

    饥饿

  • Different time is taken for different responses

    不同的响应会花费不同的时间

  • Overhead

    高架

3.扫描 (3. SCAN)

In SCAN algorithm the disk arm travels into a specific way and facilities the requests approaching in its path and after reaching the end of the disk, it converses its direction and again services the request incoming in its path. So, this algorithm works like an elevator and hence also recognized as elevator algorithm. As a result, the requests at the midrange are serviced more and those incoming behind the disk arm will have to wait.

在SCAN算法中,磁盘臂以一种特定的方式行进并为在其路径中接近的请求提供便利,到达磁盘末端后,它会反转其方向并再次为在其路径中传入的请求提供服务。 因此,该算法像电梯一样工作,因此也被认为是电梯算法。 结果,中端的请求得到了更多的服务,那些在磁盘臂后面传入的请求将不得不等待。

Pros:

优点:

  • High throughput

    高通量

  • Almost similar response times

    几乎相似的响应时间

Cons:

缺点:

  • Long waiting times

    漫长的等待时间

4. CSCAN (4. CSCAN)

In the SCAN algorithm, the disk arm over scans the way that has been scanned, after reversing its path. So, it might be likely that numerous requests are to come at the other end or there may be zero or few requests pending at the scanned area.

在SCAN算法中,磁盘臂在反转其路径后会扫描已扫描的方式。 因此,很可能有大量请求要发送到另一端,或者在扫描区域可能有零个或几个请求挂起。

These conditions are circumvented in the C-SCAN algorithm in which the disk arm as an alternative of reversing its route goes to the other end of the disk and starts checking the requests from there. So, the disk arm transfers in a circular fashion and this algorithm is also like to SCAN algorithm and hence it is known as C-SCAN (Circular SCAN).

这些条件在C-SCAN算法中得以规避,在该算法中,作为替代其路径的替代方案,磁盘臂到达磁盘的另一端并开始从那里检查请求。 因此,磁盘臂以循环方式传输,该算法也类似于SCAN算法,因此被称为C-SCAN(循环SCAN)。

Pros:

优点:

  • Provides additional invariable wait time related to SCAN algorithm

    提供与SCAN算法相关的其他不变等待时间

5.看 (5. LOOK)

It is like to the SCAN disk scheduling algorithm but the change that the disk arm in spite of going to the end of the disk goes only to the last demand to be checked in front of the head and then backs its direction from there only. Therefore, it avoids the additional postponement which arose due to pointless traversal to the last of the disk.

就像SCAN磁盘调度算法一样,但是磁盘臂即使转到磁盘末尾,也只会转到磁头前面要检查的最后一个需求,然后才从那里返回方向。 因此,它避免了由于无意义地遍历磁盘的末尾而引起的额外延迟。

6.轻巧 (6. CLOOK)

As LOOK is very much similar to SCAN algorithm, in the same way, CLOOK is alike to CSCAN disk scheduling algorithm. In the CLOOK, the disk arm in spite of working to the termination goes only to the last application to be examined in front of the head and then from there moves to the other end’s last request. Thus, it also stops the additional delay which happened due to needless traversal to the last of the disk.

由于LOOK与SCAN算法非常相似,因此CLOOK与CSCAN磁盘调度算法相似。 在CLOOK中,尽管工作到终止,磁盘臂也只会转到磁头前面要检查的最后一个应用程序,然后从那里移动到另一端的最后一个请求。 因此,它也停止了由于不必要的遍历到磁盘的最后而导致的额外延迟。

翻译自: https://www.includehelp.com/operating-systems/various-disk-scheduling-algorithms.aspx

操作系统磁盘调度算法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值