分 Suppose the hard disk with SCAN scheduling Alg has a single platter (盘面) as illustrated below , and the rotation speed for the platter is 6000 rounds per minute . The disk has only 200 tracks , and each track is composed of 100 sectors . The time cost for the disk arm to navigate between neighboring track is about 1ms. Suppose the disk arm currently hangs over the 100th track , and moves centrifugally towards lower - order tracks on the outside . The pending disk block requests are positioned on the tracks with numbers 50, 180,90,30,120, respectively , and form a queue . For each block in this queue , we do not know what are its exact sector numbers , and we can only assume that the corresponding sector randomly distributes on each track as shown below . Then , The expected time to finish the retrieval of the five sectors is1] ms . If SSTF is used , the expected time is [] ms . 0 磁道 磁头运动方向 .
时间: 2024-02-14 20:05:05 浏览: 88
磁盘调度算法(SCAN和SSTF)
4星 · 用户满意度95%
根据题目所给的信息,我们可以画出磁道与扇区的示意图:
```
| Track 1 |
| Sector 1 | Sector 2 |
|---------------------|
| Track 2 |
| Sector 1 | Sector 2 |
|---------------------|
| ... |
|---------------------|
| Track 200 |
| Sector 1 | Sector 2 |
```
其中,每个磁道有 100 个扇区,总共有 200 个磁道。
根据题目所描述的情况,我们可以计算出使用 SCAN 调度算法时,磁头移动的距离为:
- 从 100 磁道移动到 50 磁道,需要移动 50 个磁道,耗时 50ms;
- 从 50 磁道移动到 30 磁道,需要移动 20 个磁道,耗时 20ms;
- 从 30 磁道移动到 90 磁道,需要移动 60 个磁道,耗时 60ms;
- 从 90 磁道移动到 120 磁道,需要移动 30 个磁道,耗时 30ms;
- 从 120 磁道移动到 180 磁道,需要移动 60 个磁道,耗时 60ms。
因此,总共需要移动 220 个磁道,耗时为 220ms。
对于 SSTF 调度算法,我们可以按照距离当前磁头位置最近的磁道顺序来访问请求的磁道。因此,访问的顺序应该是 90、120、50、30、180。这样,总共需要移动的磁道数为 130,耗时为 130ms。
因此,答案为:
- 使用 SCAN 调度算法时,耗时为 220ms;
- 使用 SSTF 调度算法时,耗时为 130ms。
阅读全文