Home Â» Difference between SCAN and C-SCAN Disk Scheduling Algorithm

# Difference between SCAN and C-SCAN Disk Scheduling Algorithm

In this article, you will learn about the difference between the SCAN and C-SCAN Disk Scheduling Algorithm. But before discussing the differences, you have to know about the SCAN and C-SCAN Disk Scheduling Algorithm.

## What is SCAN Disk Scheduling Algorithm?

It is also known as the Elevator algorithm. In this algorithm, the head may move in both directions, i.e., the disk arm begins to move from one end of the disk to the other end and servicing all requests until it reaches the other end of the disk. After reaching the other end, the head position direction is changed and further continues servicing the requests till the end of the disk.

Example:

Letâ€™s take a disk with 180 tracks (0-179) and the disk queue having input/output requests in the following order: 75, 90, 40, 135, 50, 170, 65, 10. The initial head position of the Read/Write head is 45 and will move on the left-hand side. Find the total number of track movements of the Read/Write head using the SCAN algorithm.

Solution:

= (45-40) + (40-10) + (10-0) + (50-0) + (65-50) + (75-65) + (90-75) + (135-90) + (170-135)

= 5 + 30 +10 +50 +15 + 10 +15 + 45 + 35

= 215

1. In the SCAN disk scheduling algorithm, low variance happens in the waiting time and response time.
2. The starvation is avoided in this disk scheduling algorithm.

1. If no requests remain to be serviced, the head moves till the end of the disk.

## What is C-SCAN Disk Scheduling Algorithm?

It is also known as the Circular Elevator algorithm. It is an improved version of the SCAN disk scheduling algorithm. In this algorithm, the head works for requests in a single direction, i.e., it scans all the way to the end of a direction and then jumps to another end and services the requests in the same direction.

Example:

Letâ€™s take a disk with 180 tracks (0-179) and the disk queue having input/output requests in the following order: 75, 90, 40, 135, 50, 170, 65, 10. The initial head position of the Read/Write head is 45 and will move on the right-hand side. Find the total number of track movements of the Read/Write head using the C-SCAN algorithm.

Solution:

The initial head point is 45,

= (50-45) + (65-50) + (75-65) + (90-75) + (135-90) + (170-135) + (179-170) + (179-0) + (10-0) + (40-10)

= 5 + 15 + 10 +15 + 45 + 35 + 9 +179 + 10 + 30

= 353

1. It gives a uniform waiting time.
2. It gives a better response time.
3. The head travels from one end to the other disks end and serves all requests along the way.
4. The C-SCAN algorithm is the improved version of the SCAN scheduling algorithm.

1. If no requests remain to be serviced, the head will travel to the end of the disk.
2. It generates more search movements than the SCAN algorithm.

## Main Differences between the SCAN and C-SCAN Disk Scheduling Algorithm

Here, you will learn the main differences between the SCAN and C-SCAN Disk Scheduling Algorithm. Various differences between the SCAN and C-SCAN Disk Scheduling Algorithm are as follows:

1. SCAN Disk Scheduling Algorithm is also known as the Elevator algorithm. In this algorithm, the head may move in both directions. In contrast, the head works for requests in a single direction in the C-SCAN disk scheduling algorithm.
2. SCAN is also known as the Elevator algorithm. In contrast, the C-SCAN is also known as Circular Elevator Algorithm.
3. SCAN disk scheduling algorithm offers a longer waiting time to request locations. In contrast, the C-SCAN disk scheduling algorithm offers a uniform waiting time when requesting the locations.
4. SCAN services all the requests in forward and reversed directions. In contrast, the C-SCAN disk scheduling services the requests in a single direction only.
5. SCAN has higher throughput and gives a low variance response time. In contrast, the C-SCAN algorithm provides a better response time.