SCAN / Elevator Algorithm
A different form of disc scheduling method is the SCAN disc scheduling algorithm. We move the disc arm in a certain direction in this process (the direction can be moved to the larger value or the smallest value). Each request that comes into its route is answered, and when it reaches the end of the disc, the disc arm moves backwards, and all requests that come into its path are addressed. Because it works like an elevator, the scan disc scheduling technique is sometimes known as an elevator algorithm.
- The response time variance in SCAN disc scheduling is modest.
- Throughput is high with this algorithm.
- The response time is typical.
- There is no hunger in SCAN disc scheduling.
- The SCAN disc scheduling technique takes a long time to visit cylinders that have recently been visited by the head.
- Even if there are no requests to serve, we must move the disc head to the end of the disc in SCAN disc scheduling.
Consider a disc with tracks 0-199 and the track numbers 93, 176, 42, 148, 27, 14, 180, and 93, 176, 42, 148, 27, 14, 180, respectively, in the request queue. The read/write head is currently at position 55, and it is pointing in the direction of the bigger value. Count the total number of cylinders moved by the head, using scan disc scheduling. The disc has 200 tracks, as seen in the following example. As a result, we'll use a track line ranging from 0 to 199.
The read/write head is now at position 55. As a result, we begin at 55 and then shift the read/write head. When all requests are met, the total number of cylinders moved by the head is calculated.
= (199-50) + (199-14)
FCFS Disk Scheduling Algorithm
FCFS is an operating system scheduling method that automatically executes queued requests and processes in the order of their arrival. This is the simplest and most straight forward CPU scheduling algorithm. Processes requesting CPU first get the first CPU allocation in this type of method. A FIFO queue is used to manage this. FCFS stands for first come, first served. The FCFS (First-Come-First-Serve) disc scheduling method is the simplest of all the scheduling algorithms. Each input/output request is presented in the order that they arrive in the FCFS disk scheduling mechanism. Because FCFS addresses each request, there is no hunger in this process. Example: Purchasing a movie ticket at the box office is an example of the FCFS system in action. A person is serviced according to the queue method in this scheduling system.The person who is in the first row buys the ticket first, followed by the next ticket. This will continue until the ticket is purchased by the last person in line. The CPU process operates in a similar way when using this technique.
- There is no unlimited delay in FCFS disc scheduling.
- FCFS disc scheduling avoids hunger by giving each request an equal opportunity.
- FCFS scheduling is not the finest service available.
- Scheduling disc time is not optimal in FCFS.
Considering the same problem statement shown in the example of SCAN Disk Scheduling Algorithm above. The read/write head is now at position 55. As a result, we'll start at 55 and work our way through the FCFS sequence of read/write heads. When all requests are met, the total number of cylinders moved by the head is calculated.
= (176-55) + (176-42) + (148-42) + (148-14) + (180-14)
Difference between SCAN and FCFS Scheduling algoritm.
|1.||The scan scheduling algorithm processes requests in one way until it reaches the end of the disk, at which point the disk arm changes direction and begins serving requests in the opposite order.||The FCFS Scheduling Algorithm will process requests in the order they are received in the disc queue.|
|2.||It's possible that the request's location was recently visited by the disc arm, causing the request to take a lengthy time to complete.||There are less risks of extended postponement using the FCFS algorithm since requests are handled according to schedule.|
|3.||The SCAN algorithm outperforms the FCFS scheduling method in terms of throughput.||Of all the disk scheduling techniques, the FCFS algorithm has the lowest throughput.|
|4.||When compared to the FCFS scheduling method, the SCAN algorithm has a substantially shorter average search time.||Because it does not aim to minimise the seek time, the FCFS method has the longest average seek time of all the disc scheduling algorithms.|