ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > Class(2017-2018-1)ZSTU > student homework directory > 2015329620057_黄埔 >
hw8 Version 0
👤 Author: by 672016243qqcom 2017-12-22 00:02:22
yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">12.2 yle="font-family: 'Times New Roman', serif;">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 cylinder 125. The queue of the pendin requests, in FIFO order is:

yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">86,1470,913,1774,948,1509,1022,1750,130


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">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?

yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">Answer:

yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">a.FCFS

yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=143-86+1470-86+1470-913+1774-913+1774-948+1509-948+1509-1022+1750-1022+1750-130=7081 cylinders


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">b.SSTF


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=143-130+130-86+913-86+948-913+1022-948+1470-1022+1509-1470+1750-1509+1774-1750=1745 cylinders


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">c.SCAN


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=913-143+948-913+1022-948+1470-1022+1509-1470+1750-1509+1774-1750+4999-1774+4999-130+130-86=9769 cylinders


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">d.LOOK


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=913-143+948-913+1022-948+1470-1022+1509-1470+1750-1509+1774-1750+1774-130+130-86=3319 cylinders


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">e.C-SCAN


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=913-143+948-913+1022-948+1470-1022+1509-1470+1750-1509+1774-1750+4999-1774+4999-0+86-0+130-86=9985 cylinders


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">f.C-LOOK


yle="font-family: DengXian, serif;">yle="font-family: 'Times New Roman', serif;">The total distance=913-143+948-913+1022-948+1470-1022+1509-1470+1750-1509+1774-1750+1774-86+130-86=3363 cylinders

Please login to reply. Login

Reversion History

Loading...
No reversions found.