Circular Scan

Seek time is considered as an essential thing when it comes to operating systems. Although all the service device are connected in queues, the seek time is eventually increased, resulting in slowing down the system. Therefore, the disk scheduling algorithm such as Circular Scan is used to reduce the seek time for any service request.

Circular scanning functions the same as the scan elevator to an extent. It starts scanning the range of the disk in the direction of the nearby end and tracks all the way to the system’s end side or direction. As soon as it reaches the lowest or highest end, the head redirects to the opposite end and continue to track in the similar route. Bear in mind that the big jump does not come under or considered as the movement of head. The overall head movement counted for this algorithm depends upon the number of tracks, nonetheless still this is not the most satisfactory of all.

Some of the major advantages of the circular scan scheduling are that it offers an unvarying waiting time which helps in visiting the services in the range quickly. Also, with the help of same, we can get an improved response time. However, the limitation of the Circular Scan algorithm is that it results in much more seek movements as compared to SCAN algorithm although C-SCAN or Circular Scan algorithm is considered as an upgraded function of the SCAN process.

Algorithm

Let us look at the algorithm to get an idea about the whole process:

Step 1 – The head starts to service from one end of the disk while moving towards the end to service the possible requests in the middle.

Step 2 – When the head reaches the end of the range, it reverses its direction.

Step 3 – When turned around, the head return to the end of the disk where it started and ended without servicing any of the requests while moving back.

Step 4 The similar process will be repeated until all the requests are serviced.

Example

To understand the concept in a better way, let us have a look at one of the examples given below:

Input

Take a disk range with service requests for the cylinder number 98, 183, 41, 122, 14, 124, 65, 67. The Circular SCAN scheduling process will be considered for the same. The header is primarily at cylinder no. 53 makes its way near the highest cylinder numbers while passing towards the path and servicing requests. The cylinders are further numbered from 0 to 199. The total number of head back and forth (in cylinders) occurred at the time of servicing these requests at the given disk range is?

Output