Search code examples
algorithmoperating-systemhardwaredisk

Does the Disk-Scanning algorithm SCAN moves to sector 0 first prior to going to the end of the disk?


I was just revising for a test and I was reading the book and came across something very confusing.

The SCAN algorithm is supposed to go to the end of the disk doing various services on the way then go in reverse to the start of the disk doing the same.

But in the book theres a diagram where the SCAN algorithm goes to the start of the disk first before it goes to the end, when it starts in the middle.

So I was just wondering, from 0 - 100 if the 'head' starts at position 20, 
does it go to 0 first or 100, given the SCAN algorithm?

Hope thats alright, thanks for the help! :D


Solution

  • on wiki,http://en.wikipedia.org/wiki/Elevator_algorithm

    This algorithm is named after the behavior of a building elevator, where the elevator continues to travel in its current direction (up or down) until empty, stopping only to let individuals off or to pick up new individuals heading in the same direction.

    on the diagram you see, arm's current direction of the disk when it starts maybe from end to start, thus it moves to the start first.