Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

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

share|improve this question
    
yes,if a direction is given previously,then dont change it. –  user6656 Jan 31 '13 at 19:53

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
That makes perfect sense, thanks. The material I'm working off mentions that the head is 'working upwards through the cylinders' of the disk storage so I guess that would imply that if it's moving in an upwards direction then it would continue - since as you say changing direction could take more time). I didn't want to assume anything based on that material hence why I asked here. –  Ciaran Gallagher Dec 28 '12 at 21:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.