0
4.0kviews
Perform the computation for following scheduling algorithm :- (i) FIFO (ii) SSTF (iii) SCAN (iv) C-SCAN

On a disk with 1000 cylinders, numbers 0 to 999, compute the number of tracks the disk arm must move to satisfy all requests in the disk queue. Assume the last request serviced was at track 345 and the head is moving towards track 0, the queue in FIFO order contains requests for the following tracks:

123,874,692,475,105,376

Perform the computation for the following scheduling algorithm:-

(i) FIFO (ii) SSTF (iii) SCAN (iv) C-SCAN

1 Answer
0
219views

First Come First Serve (FCFS) Disk Scheduling

FCFS

Total Head Movements

= (345 - 123) + (874 - 123) + (874 - 692) + (692 - 475) + (475 - 105) + (376 - 105)

= 222 + 751 + 182 + 217 + 370 + 271

= 2013 Cylinders

Average Seek Length = 2013/6 = 335.5 ms


Shortest Seek Time First (SSTF) Disk Scheduling

SSTF

Total Head Movements

= (376 - 345) + (475 - 376) + (692 - 475) + (874 - 692) + (874 - 123) + (123 - 105)

= 31 + 99 + 217 + 182 + 751 + 18

= 1298 Cylinders

Average Seek Length = 1298/6 = 216.34 ms


SCAN (Elevator) Disk Scheduling

SCAN

Total Head Movements

= (345 - 123) + (123 - 105) + (105 - 0) + (376 - 0) + (475 - 376) + (692 - 475) + (874 - 692)

= 222 + 18 + 105 + 376 + 99 + 217 + 182

= 1219 Cylinders

OR

Total Head Movements = (345 - 0) + (874 - 0) = 345 + 874 = 1219 Cylinders

Average Seek Length = 1219/7 = 174.14 ms


C-SCAN (Circular SCAN) Disk Scheduling

C-SCAN

Total Head Movements

= (345 - 123) + (123 - 105) + (105 - 0) + (999 - 0) + (999 - 874) + (874 - 692) + (692 - 475) + (475 - 376)

= 222 + 18 + 105 + 999 + 125 + 182 + 217 + 99

= 1967 Cylinders

OR

Total Head Movements = (345 - 0) + (999 - 0) + (999 - 376) = 345 + 999 + 623 = 1967 Cylinders

Average Seek Length = 1967/8 = 245.88 ms

Please log in to add an answer.