0
0
Operating Systemsknowledge~6 mins

LOOK and C-LOOK variants in Operating Systems - Full Explanation

Choose your learning style9 modes available
Introduction
When a computer reads or writes data on a disk, it needs to decide the order to access different locations. This decision affects how fast the disk works. LOOK and C-LOOK are two ways to organize these disk accesses to reduce waiting time and improve speed.
Explanation
LOOK Algorithm
LOOK moves the disk arm in one direction to service all requests until there are no more requests in that direction. Then, it reverses direction and services requests on the way back. It does not go all the way to the disk's end if there are no requests there, saving time by 'looking' ahead.
LOOK optimizes disk arm movement by only going as far as the last request in each direction before reversing.
C-LOOK Algorithm
C-LOOK is similar to LOOK but instead of reversing direction, the disk arm jumps back to the first request at the beginning of the disk after reaching the last request in one direction. This jump is faster because it skips empty areas, making the disk arm movement more efficient.
C-LOOK improves efficiency by moving the disk arm in a single direction and jumping back to the start without servicing requests on the return.
Real World Analogy

Imagine a librarian who needs to collect books from shelves arranged in a line. With LOOK, the librarian walks down the aisle picking up books until no more are ahead, then walks back picking up books on the way. With C-LOOK, the librarian walks down the aisle picking up books, then quickly returns to the start without picking any books on the way back.

LOOK Algorithm → Librarian walking down the aisle picking books, then walking back picking books on the return
C-LOOK Algorithm → Librarian walking down the aisle picking books, then quickly returning to start without picking books
Diagram
Diagram
Disk Start
  │
  ▼
[Request 1] → [Request 2] → [Request 3] → [Request 4]
  ↑                             ↓
  └──────────── LOOK ──────────┘

Disk Start
  │
  ▼
[Request 1] → [Request 2] → [Request 3] → [Request 4]
  ↑                             ↓
  └────── C-LOOK (jump back) ──┘
This diagram shows how LOOK moves back and forth servicing requests, while C-LOOK moves in one direction and jumps back to the start.
Key Facts
LOOKDisk scheduling algorithm that moves the arm only as far as the last request in each direction before reversing.
C-LOOKDisk scheduling algorithm that moves the arm in one direction and jumps back to the first request without servicing on return.
Disk Arm MovementThe physical movement of the read/write head over the disk surface to access data.
Seek TimeThe time it takes for the disk arm to move to the position of the requested data.
Common Confusions
Thinking LOOK always goes to the physical end of the disk before reversing.
Thinking LOOK always goes to the physical end of the disk before reversing. LOOK only goes as far as the last request in the current direction, not the disk's physical end.
Believing C-LOOK services requests on the return jump.
Believing C-LOOK services requests on the return jump. C-LOOK skips servicing requests during the jump back to the start, making it faster.
Summary
LOOK reduces disk arm movement by only going as far as needed before reversing direction.
C-LOOK improves efficiency by moving in one direction and jumping back to the start without servicing requests on the return.
Both algorithms aim to reduce seek time and improve disk performance by optimizing the order of servicing requests.