Disk cylinder service requests algorithms

╄→尐↘猪︶ㄣ 提交于 2019-12-09 18:48:13

问题


Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is

86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms --> C-SCAN and C-LOOK

I have made some notes on what I think the order in each case would be and the resulting distance.

a. Starts at 143, scans up to 4999, jumps back to 0 (no service), then scans up again to serve what remains: C-SCAN order = 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 0, 86, 130 C-SCAN = (913-143) + (948-913) + (1022-948) + (1470-1022) + (1509-1470) + (1750-1509) + (1774-1750) + (4999-1774) + (4999-0) + (86-0) + (130-86) = 9985

** Not sure if jumping back to 0, then including 125. That wouldn't make sense because it was already covered, but wasn't 100% sure.

b. Starts at 143, goes up to the highest request, jumps down to the lowest request (no service), then goes up again: C-LOOK order = 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 86, 130 C-LOOK = (913-143) + (948-913) + (1022-948) + (1470-1022) + (1509-1470) + (1750-1509) + (1774-1750) + (1774-86) + (130-86) = 3363

** Similar confusion with the 125 here. Also, it seems like it jumps to the lowest request, not to 0, but again I'm not 100% sure.

If someone is familiar with disk scheduling algorithms, and can give some guidance, this would help me get back on the right track.

来源:https://stackoverflow.com/questions/20232717/disk-cylinder-service-requests-algorithms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!