Answer:
a) 876 ms
b) 360 ms
c) 348 ms
Step-by-step explanation:
a) When using the First-come, first serve order, the starts at the initial cylinder and is served in the same order as it arrives.
For First-come, first serve, the order is served from (20), 10, 22, 20, 2, 40, 6, and 38.
Seek time = 10 + 12 + 2+ 18 + 38 + 34 + 32 = 146 cylinder
The request uses 146 cylinders, therefore the seek time = 146 cylinder * 6 ms/cylinder = 876 ms
b) When using the Closest cylinder next the request starts at the initial cylinder and is served using the shortest movement from current position.
For Elevator algorithm, the order is served from (20), 20, 22, 10, 6, 2, 38, 40
Seek time = 0 + 2 + 12+ 4 + 4 + 36 + 2 = 60 cylinder
The request uses 146 cylinders, therefore the seek time = 60 cylinder * 6 ms/cylinder = 360 ms
c) When using the Elevator algorithm the request starts at the initial cylinder and moves upwards, then reverses direction.
For Closest cylinder next, the order is served from (20), 20, 22, 38, 40, 10, 6, 2
Seek time = 0 + 2 + 16+ 2 + 30 + 4 + 4 = 58 cylinder
The request uses 146 cylinders, therefore the seek time = 58 cylinder * 6 ms/cylinder = 348 msa) When using the First-come, first serve order, the starts at the initial cylinder and is served in the same order as it arrives.
For First-come, first serve, the order is served from (20), 10, 22, 20, 2, 40, 6, and 38.
Seek time = 10 + 12 + 2+ 18 + 38 + 34 + 32 = 146 cylinder
The request uses 146 cylinders, therefore the seek time = 146 cylinder * 6 ms/cylinder = 876 ms
b) When using the Closest cylinder next the request starts at the initial cylinder and is served using the shortest movement from current position.
For Elevator algorithm, the order is served from (20), 20, 22, 10, 6, 2, 38, 40
Seek time = 0 + 2 + 12+ 4 + 4 + 36 + 2 = 60 cylinder
The request uses 146 cylinders, therefore the seek time = 60 cylinder * 6 ms/cylinder = 360 ms
c) When using the Elevator algorithm the request starts at the initial cylinder and moves upwards, then reverses direction.
For Closest cylinder next, the order is served from (20), 20, 22, 38, 40, 10, 6, 2
Seek time = 0 + 2 + 16+ 2 + 30 + 4 + 4 = 58 cylinder
The request uses 146 cylinders, therefore the seek time = 58 cylinder * 6 ms/cylinder = 348 ms