SCAN Disk Scheduling (Elevator Algorithm)
SCAN Disk Scheduling (Elevator Algorithm)
🔷 What is SCAN Scheduling?
The SCAN algorithm moves the disk head in one direction across the disk, servicing requests along the way, and when it reaches the end, it reverses direction and continues servicing.
👉 It behaves like an elevator:
-
Goes in one direction → services requests
-
Reaches end → reverses → services on the way back
1. How SCAN Works
🔷 Step-by-Step
-
Disk head starts at current position
-
Moves in a fixed direction (towards 0 or max cylinder)
-
Services all requests in that direction
-
Reaches the end of the disk
-
Reverses direction
-
Continues servicing remaining requests
2. Example
🔹 Given:
-
Request queue:
-
Initial head position:
-
Direction:
👉 Moving toward 0
🔷 Step-by-Step Movement
Moving Left (toward 0):
-
53 → 37 → 14 → 0
Reverse Direction (toward higher cylinders):
-
0 → 65 → 67 → 98 → 122 → 124 → 183
🔷 Final Order of Service
3. Key Characteristics
1. Reduced Head Movement
-
Services nearby requests together
-
Avoids large back-and-forth jumps (unlike FCFS)
2. Fairness
-
Every request will eventually be serviced
-
No starvation
3. Bidirectional Movement
-
Head continuously moves:
-
Forward → backward → forward...
-
4. Limitations
🔴 1. Long Waiting Time for Some Requests
-
Request just behind the head:
-
Must wait until:
-
Head reaches end
-
Then reverses
-
-
🔴 2. Unnecessary Movement
-
Head always goes to end of disk
-
Even if no requests there
5. Important Insight
👉 When head reaches one end:
-
Few requests nearby (recently serviced)
-
Many requests at opposite end (waiting longer)
👉 SCAN helps balance:
-
Efficiency
-
Fairness
6. Comparison with FCFS
| Feature | FCFS | SCAN |
|---|---|---|
| Order | Arrival order | Sorted by direction |
| Head movement | Large, random | Controlled |
| Performance | Poor | Better |
| Fairness | Yes | Yes |
7. Key Takeaways
-
SCAN = Elevator algorithm
- Goes up → serves all floors
Then goes down → serves remaining
-
Head moves in one direction, then reverses
-
Improves performance by reducing seek time
-
Ensures fairness (no starvation)
-
May cause delays for requests just missed

Comments
Post a Comment