0
16kviews
Calculate average seek time for each of the following algorithm. 1.FCFS 2.SSTF 3.SCAN 4.C-SCAN.

Subject: Operating System

Topic: File Management And Input- Output Managemen

Difficulty: Medium


Suppose that a disk drive has 200 cylinder,numbered 0 to 199.The initial head position is at 100th track.The queue of pending requests in FIFO is 55,58,39,18,90,160,150,38, 184.Calculate average seek time for each of the following algorithm.

1.FCFS 2.SSTF 3.SCAN 4.C-SCAN.

1 Answer
0
1.3kviews

First Come First Serve (FCFS) Disk Scheduling

FCFS

Total Head Movements

= (100 - 55) + (58 - 55) + (58 - 39) + (39 - 18) + (90 - 18) + (160 - 90) + (160 - 150) + (150 - 38) + (184 - 38)

= 45 + 3 + 19 + 21 + 72 + 70 + 10 + 112 + 146

= 498 Cylinders

Average Seek Length = 498/9 = 55.34 ms

Shortest Seek Time First (SSTF) Disk Scheduling

SSTF

Total Head Movements

= (100 - 90) + (90 - 58) + (58 - 55) + (55 - 39) + (39 - 38) + (38 - 18) + (150 - 18) + (160 - 150) + (184 - 160)

= 10 + 32 + 3 + 16 + 1 + 20 + 132 + 10 + 24

= 248 Cylinders

Average Seek Length = 248/9 = 27.56 ms

SCAN (Elevator) Disk Scheduling

SCAN

Total Head Movements

= (150 - 100) + (160 - 150) + (184 - 160) + (199 - 184) + (199 - 90) + (90 - 58) + (58 - 55) + (55 - 39) + (39 - 38) + (38 - 18)

= 50 + 10 + 24 + 15 + 109 + 32 + 3 + 16 + 1 + 20

= 280 Cylinders

OR

Total Head Movements = (199 - 100) + (199 - 18) = 99 + 181 = 280 Cylinders

Average Seek Length = 280/10 = 28 ms

C-SCAN (Circular SCAN) Disk Scheduling

C-SCAN

Total Head Movements

= (150 - 100) + (160 - 150) + (184 - 160) + (199 - 184) + (199 - 0) + (18 - 0) + (38 - 18) + (39 - 38) + (55 - 39) + (58 - 55) + (90 - 58)

= 50 +10 + 24 + 15 + 199 + 18 + 20 + 1 + 16 + 3 + 32

= 388 Cylinders

OR

Total Head Movements = (199 - 100) + (199 - 0) + (90 - 0) = 99 + 199 + 90 = 388 Cylinders

Average Seek Length = 388/11 = 35.28 ms

Please log in to add an answer.