2. suppose that a disk has 200 cylinders , numbered 0 to 199 .
the drive is
currently serving a request at cylinder 53 , and the previous request was at
cylinder 25. The queue of pending requests , in FIFO order is
98 , 183 , 37 , 122 , 14 , 124 , 65 , 67
Starting from the current head position, show the total distance ( in cylinders) that
the disk arm moves to satisfy all the pending requests for each of the following
disk-scheduling disciplines?
I. FCFS
II. SSTF
III. LOOK
IV. C-LOOK
V. Scan
VI. C-Scan
ANSWER
I. FCFS
0 14 37 53 65 67 98 122 124 183 199
53 98
183
37
122
14
65 124
67
The total distance:
(98-53)+(183-98)+(183-37)+(122-37)+(122-14)+(124-14)+(124-
65)+(67-65)= 640 Cylinders
In another way:
FCFS: 53 , 98 , 183 , 37 , 122 , 14 , 124 , 65 , 67
ii. SSTF
0 14 37 53 65 67 98 122 124 183 199
65
37 67
14
98
122
124
183
The total distance:
(65-53)+(67-65)+(67-37)+(37-14)+(98-14)+(122-98)+(124-122)+(183-
124)= 236 Cylinders
In another way:
SSTF: 53 , 65 , 67 , 37 , 14 , 98 , 122 , 124 , 183
iii. Scan
0 14 37 53 65 67 98 122 124 183 199
65
67
98
122
124
183
199
37
14
The total distance:
(65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(199-183)+(199-
37)+(37-14)= 331 Cylinders
In another way:
Scan: 53 , 65 , 67 , 98 , 122 , 124 , 183 , 199 , 37 , 14
Iv. Look
0 14 37 53 65 67 98 122 124 183 199
65
67
98
122
124
183
37
14
The total distance
(65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(183-37)+(37-14)=
299 Cylinders
In another way
LOOK: 53 , 65 , 67 , 98 , 122 , 124 , 183 , 37 , 14
V. C-Scan
0 14 37 53 65 67 98 122 124 183 199
65
67
98
122 124
183 199
0 14
37
The total distance
(53-65)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(199-183)+( 14-0)+(37-
14)=
In another way:
C-Scan: 53 , 65 , 67 , 98 , 122 , 124 , 183 , 199 , 0 , 14 , 37
VII. C-LOOK
0 14 37 53 65 67 98 122 124 183 199
The total distance:
(65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(183-14)+(37-14) =
322 Cylinders
In another way
C-LOOK: 53 , 65 , 67 , 98 , 122 , 124 , 183 , 14 , 37