Wednesday, November 10, 2010

Operating System Concepts 8e: Exercise 12.16

Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4999. The drive is currently 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 pending requests, for each of the following disk-scheduling algorithms?
  1. FCFS
  2. SSTF
  3. SCAN
  4. LOOK
  5. C-SCAN
  6. C-LOOK
  1. FCFS:
    143→86→1470→913→1774→948→1509→1022→1750→130
    7081 cylinders
  2. SSTF:
    143→130→86→913→948→1022→1470→1509→1750→1774
    1745 cylinders
  3. SCAN: 125→143 means the movement is going in the increasing direction.
    143→913→948→1022→1470→1509→1750→1774→4999→130→86
    9769
  4. LOOK:
    143→913→948→1022→1470→1509→1750→1774→130→86
    3319 cylinders
  5. C-SCAN:
    143→913→948→1022→1470→1509→1750→1774→4999→0→86→130
    9985 cylinders
  6. C-LOOK:
    143→913→948→1022→1470→1509→1750→1774→86→130
    3363 cylinders

No comments:

Post a Comment