159k views
0 votes
Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 2150, and the previous request was at cylinder 1805. The queue of pending requests, in FIFO order, is: 2069, 1212, 2296, 2800, 544, 1618, 356, 1523, 4965, 3681. 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?1) FCFS2) SSTF3) SCAN4) LOOK5) C-SCAN6) C-LOOK

User Bertone
by
3.5k points

1 Answer

1 vote

Answer:

13011, 7586, 7492 , 7424, 9917, and 9137.

Step-by-step explanation:

(1). FCFS is generally based on what is refer to as first come, first serve. That is to say the first one to come will be treated first so, we have that;

FCFS = 81 + 857 + 1084 + 504 + 2256 + 1074 + 1262 + 1167 + 3442 + 1284 = 13011.

(2). (SSTF) Is all about the shortest distance, for example in this question the shortest distance is =

Thus;

Total distance = (2150 - 2069) + (2296 - 2069) + ( 2296 - 2800) +( 3681 - 2800) + (4965 - 3681) + ( 4965 - 1618) + ( 1618-1523) + ( 1523-1212) + ( 1212-544) + ( 544 - 356).

=81 + 227 + 504 + 881 + 1284 + 3347 + 95 + 311 + 668 + 188 = 7586.

(3).SCAN deals with the processing of the nearest request

The distance =146 + 504 +881 + 1284 + 34(4999-4965) + 2930(4999-2069)

+ 451 + 95 + 311 + 668 +188 = 7492.

(4). LOOK is just like scan.

The distance = 146 + 504 + 881 + 1284 + 2896 + 451 + 95 + 311 + 668 + 188 = 7424.

(5). C-SCAN: this is the kind of scan from one end to the other.

The distance = 146 + 504 +881 +1284 + 34 (4999 - 4965) + 4999 (4999 -0 )+ 356 (356 -0 )+ 188 + 668 + 311 + 95 + 451 = 9917.

(6). C-LOOK : moves in the following order: 2150, 2296, 2800, 3681, 4965, here head moves back 356, 544, 1212, 1523, 1618, 2069.

Thus;

The distance = 146 + 504 + 881+ 1284 + 4609 (4965 - 356) + 188 + 668 + 311+ 95 + 451 = 9137.

User Kuddusi
by
3.4k points