0
59kviews
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 at cylinder 125.

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 at cylinder 125. The queue of pending requests in FIFO order is 86,1470,913,1774,948,1509,1022,1750, 130.Starting from current head position,what is a total distance(in cylinders) that the Disk arm move to satisfy all a pending requests,for each of the following disk Scheduling algorithms?

1.FCFS 2.SSTF 3.SCAN 4.LOOK.

1 Answer
5
12kviews

Solution:

(1) FCFS:

  • The FCFS algorithm just follows the order of the requests given.

  • The FCFS schedule is: 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

  • Movements: 57 + 1384 + 557 + 861 + 826 + 561 + 487 + 728 + 1620

  • The total distance is: 7,081

(2) SSTF:

  • The SSTF algorithm starts a cylinder 143 and from there successively selects the shortest request from its current location.

  • The SSTF schedule is: 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774

  • Movements: 13 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24

  • The total distance is: 1,745

(3) SCAN:

  • The SCAN algorithm continues in the direction of the head servicing requests until the end of the disk. It then reverses, catching all requests back to the other end of the disk. The head continuously scans back and forth across the disk.

  • The SCAN schedule is: 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 130, 86

  • Movements: 770 + 35 + 74 + 448 + 39 + 241 + 24 + 3225 + 4869 + 44

  • The total distance is: 9,769

(4) LOOK:

  • The LOOK algorithm is just like the SCAN algorithm, except the disk head only goes as far as the last request in each direction.

  • The LOOK schedule is: 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86

  • Movements: 770 + 35 + 74 + 448 + 39 + 241 + 24 + 1644 + 44

  • The total distance is: 3,319

Please log in to add an answer.