Compute the average traveling distance in the following IO p
Compute the average traveling distance in the following I/O problem using SCAN and SSTF scheduling. The I/O queue has the following requests: 64, 12, 55, 85, 14, 36, 62, 45, 24. The R/W heads are currently positioned at track 50.
Solution
The I/O queue has the following requests: 64,12,55,85,14,36,62,45,24
current position of R/W heads = track 50
SCAN
50 -----> 55 (5)
55----->62 (7)
62 ----->64 (2)
64 ------> 85 (21)
45 <--------- 85 (40)
36 <--------- 45 (9)
24 <--------- 36 (12)
14 <--------- 24 (10)
12 <------- 14 (2)
Total distance covered = 5+7+2+21+40+9+12+10+2 = 108
Average distance = 108/9 = 12
SSTF(Shortest Seek Time First)
50 -----> 55 (5)
55 ------> 62 (7)
62 ----> 64 (2)
45 <------ 64 (19)
36 <------ 45 (9)
24 <-------- 36 (12)
14 <-------- 24 (10)
12 <------- 14 (2)
12 ---------->85 (73)
Total distance = 5+7+2+19+9+12+10+2+73 =139
Average distance 139/9 = 15.33
