World's most popular travel blog for travel bloggers.

SSTF disk scheduling algorithm? What if lowest seek times are equal in either direction?

, , No Comments
Problem Detail: 

Using the Shortest-Seek-Time-First (SSTF) disk scheduling algorithm (where we select a request with a minimum seek time from the current head position), what happens if the requests in both directions from the current head position are equal?

For example, if the head position is at 25, and the nearest positions are 5 and 45, how do we determine which one to select?

Thanks

Asked By : Ciaran Gallagher

Answered By : Paresh

Short answer: Depends on implementation.

Long answer: Ties could be broken randomly, or some fixed direction might be preferred. A popular strategy is to select that position first which does not require the head to change direction (since changing direction could take more time). So suppose that the head has moved from 20 to 25, it might prefer 45 next instead of 5 (since it was going towards the higher side). It could also depend on what the further instructions are going to be. Basically, the answer depends on what tie-breaking policy is selected in the implementation, and how complicated the implementation can be.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/7625

0 comments:

Post a Comment

Let us know your responses and feedback