Share
Explore BrainMass

Calculating Distance for Algorithms

You will calculate the total distance that a disk arm moves to satisfy pending requests, for different disk scheduling algorithms.

Steps

1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in first-in-first-out (FIFO) order, is as follows:

92; 1,320; 879; 1,984; 1,023; 1,690; 1,123; 2,002; and 93

2. Calculate the total distance in cylinders starting from the current head position that the disk arm moves to satisfy all the pending requests for each of the following disk scheduling algorithms:

FCFS
SSTF
SCAN
LOOK
C-SCAN

Solution Preview

If you do not already have it, I recommend an excellent book called "Operating System Concepts" by Silberschatz, Galvin, and Gagne.

FCFS: First Come First Serve
The simplest and easiest to implement, you just process the requests in the order that they came in: 92 1320 879 1984 1023 1690 1123 2002 93
Total movement: from 143 to 92, to 1320, to 879, to 1984... = 51 + 1228 + 441 + 1105 + 961 + 667 + 879 + 1909 = 7241

SSTF: Shortest Seek Time First
Always process the request that requires moving the head the least from the current position. ...

Solution Summary

This solution discusses calculations of distance for algorithms.

$2.19