C-LOOK (Circular LOOK) is an optimized version of the LOOK algorithm, similar to how C-SCAN is an enhancement of SCAN. In C-LOOK, the disk head services requests only in one direction until it reaches the last request in that direction, then immediately jumps back to the first request in the same direction without traveling to the end of the disk.
How C-LOOK Works
C-LOOK is designed to reduce unnecessary head movements while still providing relatively uniform wait times. It's more efficient than C-SCAN because it doesn't travel all the way to the disk boundaries when there are no requests there.
The algorithm follows these steps:
- The disk arm moves in a particular direction (typically towards higher cylinder numbers), servicing all requests in its path
- When it reaches the last request in that direction, it immediately jumps to the lowest pending request in the queue
- It then begins moving in the same direction as before, servicing requests
- This creates a circular pattern but avoids unnecessary movements to disk boundaries
Example Calculation
Let's say we have a disk with 200 cylinders (0-199), and the head is currently at position 50, moving towards higher cylinder numbers. The request queue is:
| Request Sequence | 95 | 180 | 34 | 119 | 11 | 123 | 62 |
|---|
The C-LOOK algorithm will sort these requests based on the current head position and direction of movement:
| Requests Sorted by C-LOOK Algorithm (Initial Position: 50, Direction: Increasing) | ||||||
|---|---|---|---|---|---|---|
| 62 | 95 | 119 | 123 | 180 | 11 | 34 |
The head movements will be:
| Head Movement | |50-62| | |62-95| | |95-119| | |119-123| | |123-180| | |180-11| | |11-34| |
|---|---|---|---|---|---|---|---|
| Distance | 12 | 33 | 24 | 4 | 57 | 169 | 23 |
Total head movement = 12 + 33 + 24 + 4 + 57 + 169 + 23 = 322 cylinders
Note: In C-LOOK, the head jumps directly from the highest request (180) to the lowest request (11) without going to the disk boundaries.
Differences Between C-SCAN and C-LOOK
- In C-SCAN, the head moves to the end of the disk (boundary) before jumping back to the beginning
- In C-LOOK, the head only moves to the last request in a direction before jumping to the first request in the queue
- C-LOOK typically has less total seek distance than C-SCAN because it avoids unnecessary movements to disk boundaries
- Both provide uniform waiting times, but C-LOOK is generally more efficient in terms of head movement
Advantages
- More efficient than C-SCAN by eliminating unnecessary head movements to disk boundaries
- Provides relatively uniform waiting times for all cylinders
- Reduces total seek time compared to C-SCAN while maintaining fairness
- Better performance for systems with clustered I/O requests
Disadvantages
- Still has a potentially long jump when moving from the highest to lowest request
- More complex to implement than simpler algorithms like FCFS
- May not perform as well as other algorithms for certain request patterns
- Does not consider request arrival times, potentially leading to starvation in heavy load situations