Difference Between SCAN and LOOK Disk Scheduling Algorithms

tutorials

SCAN and LOOK are disk scheduling algorithms used to manage disk requests efficiently. SCAN, also known as the "Elevator Algorithm," moves the disk arm to the end of the queue in one direction before reversing, while LOOK improves on this by only going as far as the last request in each direction, reducing unnecessary movement. Both aim to optimize seek time by minimizing disk arm travel.
 

What is the SCAN Disk Scheduling Algorithm?

The SCAN algorithm, also known as the elevator algorithm, is designed to handle disk scheduling by moving the disk arm in one direction, servicing all requests until it reaches the end of the disk, then reversing direction and servicing requests on the way back. This approach resembles the movement of an elevator, thus the name.

How SCAN Works:

  1. The disk arm moves from one end of the disk to the other, servicing all requests along the way.
  2. When the arm reaches the end, it reverses direction and services requests on the return trip.

Example:

If the disk arm starts at the outermost track and requests are located at tracks 10, 22, 30, and 50, the arm will first service 10, 22, 30, and then reach 50 before reversing direction to service any pending requests on the way back.

What is the LOOK Disk Scheduling Algorithm?

The LOOK algorithm is similar to SCAN but with a key difference: it only moves the disk arm as far as the furthest request in either direction before reversing direction. This reduces the unnecessary movement of the arm when there are no requests beyond the furthest request in the current direction.

How LOOK Works:

  1. The disk arm moves towards the direction of the next request, servicing requests until it reaches the last request in that direction.
  2. It then reverses direction and services any remaining requests on the return trip.

Example:

If the disk arm starts at track 20 and requests are located at tracks 5, 12, 25, and 35, the arm will move towards track 35, servicing 25 and 35, and then reverse direction to service requests at tracks 12 and 5 on the way back.

Difference Between SCAN and LOOK Disk Scheduling Algorithms:

BasisSCANLOOK
MovementMoves the disk arm to the end of the disk before reversing direction.Moves the disk arm only to the furthest request in the current direction.
EfficiencyMay result in unnecessary movements as it always goes to the end of the disk.More efficient as it does not move beyond the furthest request.
Request HandlingServices all requests in the path, including those beyond the furthest request in the current direction.Services only the requests within the range of the furthest request.
Disk Arm MovementThe arm travels to the end of the disk and back, which can be time-consuming.The arm moves more directly between requests, reducing movement.
Algorithm ComplexityCan be more complex due to additional movements.Generally simpler as it avoids unnecessary movements.
Example ScenarioIf requests are at tracks 5, 12, 25, and 35, the arm will move from 0 to 50, service all requests, and then return.If requests are at tracks 5, 12, 25, and 35, the arm will move from 20 to 35, service requests at 35, 25, and then reverse to 12 and 5.
tools

Operating Systems

Related Articles