Difference Between SSTF and C-LOOK Disk Scheduling Algorithms


Disk scheduling algorithms are used to determine the order in which disk requests are serviced, aiming to minimize disk head movements and optimize disk access time. Two commonly used disk scheduling algorithms are Shortest Seek Time First (SSTF) and C-LOOK. While both algorithms aim to improve disk performance, they have distinct approaches and characteristics.

SSTF (Shortest Seek Time First) Disk Scheduling Algorithm

SSTF is a disk scheduling algorithm that selects the request with the shortest seek time from the current head position to the next request. Some key features of SSTF (Shortest Seek Time First) Disk Scheduling Algorithm.

Here are some key features of SSTF Disk scheduling algorithm −

  • Movement Pattern − SSTF aims to minimize the total seek time by always selecting the nearest request, regardless of the direction. It works by moving the disk head to the closest track with a pending request.

  • Seek Time − SSTF provides low average seek time and is highly efficient when the workload is balanced or there are no outliers.

  • Starvation − SSTF may result in starvation for requests located farther away from the current head position, as they might never be serviced if there are constant requests closer to the head.

  • Implementation Simplicity − SSTF is relatively easy to implement compared to other scheduling algorithms.

C-LOOK Disk Scheduling Algorithm

C-LOOK is a disk scheduling algorithm that works similar to the LOOK algorithm but with a circular movement pattern. It scans the disk in a specific direction, serving all pending requests in that direction and then moves to the opposite end of the disk without serving any requests. Some key features of C-LOOK Disk Scheduling Algorithm.

Here are some key features of C-LOOK Disk Scheduling Algorithm −

  • Movement Pattern − C-LOOK moves the disk head only in one direction until it reaches the end of the disk, where it reverses its direction without servicing any requests. This pattern prevents unnecessary head movement and improves efficiency.

  • Seek Time − C-LOOK can provide lower seek times compared to other algorithms, especially if the workload is concentrated towards a specific area of the disk. It eliminates the back-and-forth movement of the head, reducing overall seek time.

  • Starvation − C-LOOK may result in starvation for requests located on the opposite side of the disk from the initial head position if the workload is imbalanced.

  • Implementation Complexity − Implementing C-LOOK can be slightly more complex than SSTF due to the circular movement and the need to handle the reversal of the head direction.

Difference Between SSTF and C-LOOK Disk Scheduling Algorithms

The following table highlights the major differences between SSTF and C-LOOK disk scheduling algorithms −

Criteria

SSTF

C-LOOK

Scan Direction

SSTF dynamically selects the next request with the shortest seek time from the current head position in either direction (inward or outward).

C-LOOK scans in a fixed direction (e.g., from the outermost track to the innermost track) and only reverses direction when it reaches the end of the disk.

Track Access Order

SSTF may service requests out of order, as it prioritizes minimizing seek time. It can jump from the innermost track to the outermost track or vice versa, depending on the shortest seek time.

C-LOOK services requests in a sequential manner in the same direction of the fixed scan. It always moves toward the nearest request in the current scan direction.

Disk Head Movement

SSTF seeks to reduce head movements by servicing requests close to the current head position. It may result in increased seek time for requests located farther away.

C-LOOK aims to minimize head movements by focusing on requests in a particular direction and avoids unnecessary movement to distant tracks. It can lead to more consistent and predictable seek time.

Handling New Requests

SSTF continuously selects the next request with the shortest seek time, potentially ignoring new requests that arrive after the current selection.

C-LOOK completes the current scan and then scans back to the beginning, which allows new requests to be serviced on the subsequent scan.

Efficiency

SSTF can be highly efficient when the disk workload consists of predominantly small and random requests, reducing average seek time. However, it may suffer from starvation for requests located far away from the current head position.

C-LOOK performs well in scenarios where the majority of requests are concentrated within a specific region of the disk, providing fair disk access and avoiding excessive seek time for distant requests. It may not be optimal for workloads with scattered requests across the entire disk.

Disk Utilization

SSTF may experience suboptimal disk utilization when there are many scattered requests or idle periods between requests, as it focuses on minimizing seek time rather than maximizing throughput.

C-LOOK generally achieves better disk utilization since it scans in a fixed direction and avoids unnecessary back-and-forth movement. It can maintain a more consistent and continuous flow of requests.

Example

SSTF is commonly used in scenarios with high variability and random disk access patterns, such as interactive systems or workloads with a mix of short and long requests.

C-LOOK is suitable for workloads with a specific range or concentrated requests, such as database systems or situations where locality of reference is present.

Conclusion

In summary, SSTF and C-LOOK disk scheduling algorithms have different approaches to optimizing disk access. SSTF focuses on selecting the closest request, minimizing seek time but potentially leading to request starvation. On the other hand, C-LOOK offers fairness in handling requests, with predictable head movements but potentially suboptimal performance in certain scenarios. The choice between these algorithms depends on the workload characteristics and specific requirements of the system, such as request patterns and distribution.

Updated on: 13-Jul-2023

100 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements