In: Computer Science
Suppose the following disk request sequence (track numbers) for a disk with 200 tracks is given: 23, 89, 132, 42, 97, 35, 187 Assume that the initial position of the R/W head is on track 100. Draw the diagrams for arm movement for the seek strategies given below. Calculate the total and average number of tracks travelled and conclude which strategy performed best in the given scenario. Note: You can use pencil and paper method to draw, but you have to write your id on every pic included in the answer sheet. a) FCFS [3 Marks] b) SSTF [3 Marks] c) SCAN [3 Marks] d) C-SCAN [3 Marks] e) LOOK [3 Marks] f) C-LOOK
Answer
A) FCFS(First come firt serve)
In this method the disk head will move in order of the queue.
In this problem, the disk head will move from 100 to 23 because 23 is the first location in the queue.
The total track travelled=(100-23)+(89-23)+(132-89)+(132-42)+(89-42)+(89-23)+(187-35)= 541
Average track travelled=total track travelled / number of points =541 / 8=67.6
B)SSTF(Shortest seek time first)
In this method, the disk head will move to the next shortest distance location.
In this problem from 100, the disk head moved to 97 because that location has the least distance from the head(100)
The total track travelled=(100-23)+(132-23)+(187-132)+(100-97)+(97-89)+(89-42)+(42-35)+(35-23)+(132-23)+(187-132)=241
Average track travelled=241 / 8=30.1
C)SCAN
In this method, the disk head will move to left or right and visit all locations on that path and reach at end location(0 or 199) after that it will reverse the direction and move to the next location.
n this problem, The disk head moves to the right side and visit all location on that path and reaches at 199 and then reverse its direction and visit remaining locations.
The total track travelled=(132-100)+(187-132)+(199-187)+(199-97)+(97-89)+(89-42)+(42-35)+(35-23)=275
Average track travelled=275 / 8=34.3
D)C-SCAN
This method is the same as SCAN but the disk head will move to both extreme points( 0 and 199).
In this problem the disk head moves to the right side and reaches 199 on that path, it will visit all locations after that the disk head will reverse and move to 0 on that path it will visit all locations.
The total track travelled=(132-100)+(187-132)+(199-187)+(199-0)+(23-0)+(35-23)+(42-35)+(89-42)+(97-89)=395
Average track travelled=395 / 8=49.3
E)LOOK
In this method, there is a small modification from c scan. the disk head will only move up to the given last location (187 or 23) it will not touch extreme points.
The total track travelled=(132-100)+(187-132)+(187-97)+(97-89)+(89-42)+(42-35)+(35-23)= 251
Average track travelled=251 / 8=31.3
F)C-LOOK
In this method same as look but after visiting end location it will goes to the farest point in the opposite side
In this problem as you can see after reaching 187 the disk head move to 23.
The total track travelled=(132-100)+(187-132)+(187-23)+(35-23)+(42-35)+(89-42)+(97-89)=349
Average track travelled=349 / 8=43.6
Selecting best among this
SSTF(Shortest seek time first) is the best among them will less travel time (241)