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:

Difference between SCAN and C-SCAN Disk Scheduling Algorithm

Total head movements,

Initial head point is 45,

= (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

Advantages and Disadvantages of SCAN Disk Scheduling Algorithm

There are various advantages and disadvantages of SCAN disk scheduling algorithm. These advantages and disadvantages are as follows:

Advantages

  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.

Disadvantages

  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:

Difference between SCAN and C-SCAN Disk Scheduling Algorithm

Total head movements,

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

Advantages and Disadvantages of C-SCAN Disk Scheduling Algorithm

There are various advantages and disadvantages of the C-SCAN disk scheduling algorithm. These advantages and disadvantages are as follows:

Advantages

  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.

Disadvantages

  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

Difference between 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.

Head-to-head Comparison between the SCAN and C-SCAN Disk Scheduling Algorithm

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

SCAN Disk Scheduling AlgorithmC-SCAN Disk Scheduling Algorithm
It is also known as the Elevator algorithm.It is also known as the Circular Elevator algorithm.
It offers a longer waiting time to request locations.It offers a uniform waiting time to request locations.
It contains higher throughput and gives a low variance response time.It gives a better response time.
Its services all the requests in both forward and reversed directions.Its services the requests in only a single direction only.
In the SCAN algorithm example, the head moves from 45 to the left, servicing all requests in that direction until it reaches the left end, and it changes the head position to the right end, processing all requests from 0 to 179.In the C-SCAN algorithm example, the head moves from 45 to the right-hand side and serves all requests until it reaches the right end, and then it doesn't reverse its direction but rather jumps to the other end of the disk and serves the requests on its right end.





Latest Courses