Computer Science, asked by oknishantsharma1033, 3 months ago

Suppose that a disk drive has 3,000 cylinders, numbered 0 to 2999. The drive is currently serving a request at cylinder 188, and the previous request was at cylinder 150. The queue of pending requests, in FIFO order, is: 86, 913, 1774, 448, 2509, 1022, 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? A. FCFS
B. SSTF
C. LOOK D. SCAN
E. C-LOOK
F. C-SCAN

Answers

Answered by Tulsi4890
0

A. FCFS (First-Come, First-Served)

In the FCFS algorithm, the disk arm serves the pending requests in the order they are received, without taking into account their positions on the disk. Therefore, to satisfy the pending requests, the disk arm would need to move the following distances:

86 - 188 = -102 cylinders (the disk arm moves to the left)

913 - 86 = 827 cylinders (the disk arm moves to the right)

1774 - 913 = 861 cylinders (the disk arm moves to the right)

448 - 1774 = -1326 cylinders (the disk arm moves to the left)

2509 - 448 = 2061 cylinders (the disk arm moves to the right)

1022 - 2509 = -1487 cylinders (the disk arm moves to the left)

130 - 1022 = -892 cylinders (the disk arm moves to the left)

The total distance the disk arm moves is -102 + 827 + 861 - 1326 + 2061 - 1487 - 892 = -168 cylinders.

B. SSTF (Shortest Seek Time First)

In the SSTF algorithm, the disk arm serves the pending requests in the order of the shortest seek time, which is the distance between the current position of the disk arm and the position of the pending request. Therefore, to satisfy the pending requests, the disk arm would need to move the following distances:

86 - 188 = -102 cylinders (the disk arm moves to the left)

130 - 188 = -58 cylinders (the disk arm moves to the left)

448 - 188 = 260 cylinders (the disk arm moves to the right)

913 - 188 = 725 cylinders (the disk arm moves to the right)

1022 - 188 = 834 cylinders (the disk arm moves to the right)

1774 - 188 = 1586 cylinders (the disk arm moves to the right)

2509 - 188 = 2321 cylinders (the disk arm moves to the right)

The total distance the disk arm moves is -102 - 58 + 260 + 725 + 834 + 1586 + 2321 = 4658 cylinders.

C. LOOK

In the LOOK algorithm, the disk arm serves the pending requests in the order they are received, moving towards the nearest end of the disk until it reaches the last request in that direction, and then reversing direction to serve the remaining requests. In this case, the disk arm would need to move the following distances:

86 - 188 = -102 cylinders (the disk arm moves to the left)

130 - 86 = 44 cylinders (the disk arm moves to the right)

448 - 130 = 318 cylinders (the disk arm moves to the right)

913 - 448 = 465 cylinders (the disk arm moves to the right)

1022 - 913 = 109 cylinders (the disk arm moves to the right)

1774 - 1022 = 752 cylinders (the disk arm moves to the right)

2509 - 1774 = 735 cylinders (the disk arm moves to the right)

The total distance the disk arm moves is -102 + 44 + 318 + 465 + 109 + 752 + 735 = 2711 cylinders.

D. SCAN

In the SCAN algorithm, the disk arm serves the pending requests in the order they are received, moving towards one end of the disk until it reaches the last request in that direction, and then reversing direction and serving the requests in the opposite direction.

To learn more about disk-scheduling algorithms from the given link.

https://brainly.com/question/17010124

#SPJ1

Similar questions