Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
C-LOOK vs C-SCAN Disk Scheduling Algorithm
In computer systems, disk scheduling is required for smooth operation of the system. Disk scheduling is done by the operating system, which schedules I/O requests arriving at the disk. Therefore, disk scheduling is also called I/O scheduling. Multiple I/O requests from different processes may arrive simultaneously, but the disk controller can serve only one request at a time, requiring all others to wait for the next schedule.
Operating systems use several disk scheduling algorithms such as FCFS (First Come First Served), SSTF (Shortest Seek Time First), SCAN, C-SCAN (Circular SCAN), LOOK, and C-LOOK (Circular LOOK).
What is C-LOOK Algorithm?
C-LOOK stands for Circular-LOOK and is an improved version of the LOOK algorithm. In C-LOOK, the disk head moves in one direction serving all requests until it reaches the last request in that direction. Instead of continuing to the disk edge, it immediately jumps to the beginning and starts serving requests in the same direction again, creating a circular pattern.
C-LOOK Example
Consider a disk with 200 tracks (0 to 199) and the following I/O request queue
Requests: 24, 92, 130, 45, 185
Current head position: 99
Moving left first, the head serves requests in order: 92 ? 45 ? 24, then jumps to the rightmost request and continues: 130 ? 185.
Total head movements: |99-92| + |92-45| + |45-24| + |24-130| + |130-185| = 7 + 47 + 21 + 106 + 55 = 236 cylinders
Average head movement: 236 รท 5 = 47.2 cylinders
What is C-SCAN Algorithm?
C-SCAN stands for Circular SCAN and is also known as the Circular Elevator Algorithm. Unlike C-LOOK, C-SCAN moves the head from one end of the disk to the other end, serving all requests in between. When it reaches the end, it immediately returns to the beginning without serving any requests and starts scanning again in the same direction.
C-SCAN provides uniform waiting time and better response time but requires more seek movements as it always scans to the disk edges, even when no requests exist there.
Key Differences Between C-LOOK and C-SCAN
| Aspect | C-LOOK | C-SCAN |
|---|---|---|
| Movement Pattern | Moves only between the first and last requests | Moves from disk start to end regardless of request locations |
| Seek Time | Lower seek time (stops at last request) | Higher seek time (goes to disk edge) |
| Efficiency | More efficient due to reduced unnecessary movements | Less efficient due to movement to disk edges |
| Waiting Time | Slight variation in waiting time | More uniform waiting time |
| Response Time | Variable response time | More predictable response time |
| Implementation | Requires tracking of request boundaries | Simpler implementation (fixed start/end points) |
Advantages and Disadvantages
C-LOOK Advantages
Eliminates unnecessary movement to disk edges
Better performance with lower seek time
More efficient utilization of disk head movement
C-SCAN Advantages
Provides uniform waiting time for all requests
Simpler to implement and understand
Predictable response times
Conclusion
C-LOOK is generally more efficient than C-SCAN because it eliminates unnecessary movements to disk edges when no requests exist there. While C-SCAN provides more uniform response times, C-LOOK offers better overall performance by optimizing head movement patterns based on actual request locations.
