Algorithms

Generate Report
FCFS 
SSTF 
SCAN 
CSCAN 
LOOK 
CLOOK 
Information On Disk Scheduling.
Disk scheduling is done by operating systems to schedule I/O requests arriving for the disk. Disk scheduling is also known as I/O scheduling.
Disk scheduling is important because:
1) Multiple I/O requests may arrive by different processes and only one I/O request can be served at a time by the disk controller. Thus other I/O requests need to wait in the waiting queue and need to be scheduled.
2) Two or more request may be far from each other so can result in greater disk arm movement.
3) Hard drives are one of the slowest parts of the computer system and thus need to be accessed in an efficient manner.
FCFS
FCFS is the simplest of all the Disk Scheduling Algorithms. In FCFS, the requests are addressed in the order they arrive in the disk queue.
Advantages:
1) Every request gets a fair chance
2) No indefinite postponement
Disadvantages:
1)Does not try to optimize seek time
2)May not provide the best possible service
Illustration on FCFS

Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is : 50
So, total seek time:
=(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16)
=642

SSTF
In SSTF (Shortest Seek Time First), requests having shortest seek time are executed first. So, the seek time of every request is calculated in advance in the queue and then they are scheduled according to their calculated seek time. As a result, the request near the disk arm will get executed first. SSTF is certainly an improvement over FCFS as it decreases the average response time and increases the throughput of system.
Advantages:
1) Average Response Time decreases
2) Throughput increases
Disadvantages:
1) Overhead to calculate seek time in advance.
2) Can cause Starvation for a request if it has higher seek time as compared to incoming requests.
3) High variance of response time as SSTF favours only some requests.
Illustration on SSTF

Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is : 50
So, total seek time:
=(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-40)+(190-170)
=208

SCAN
In SCAN algorithm the disk arm moves into a particular direction and services the requests coming in its path and after reaching the end of disk, it reverses its direction and again services the request arriving in its path. So, this algorithm works as an elevator and hence also known as elevator algorithm. As a result, the requests at the midrange are serviced more and those arriving behind the disk arm will have to wait.
Advantages:
1) High throughput.
2) Low variance of response time.
3) Average response time.
Disadvantages:
1)Long waiting time for requests for locations just visited by disk arm.
Illustration on SCAN
CSCAN
In SCAN algorithm, the disk arm again scans the path that has been scanned, after reversing its direction. So, it may be possible that too many requests are waiting at the other end or there may be zero or few requests pending at the scanned area. These situations are avoided in CSCAN algorithm in which the disk arm instead of reversing its direction goes to the other end of the disk and starts servicing the requests from there. So, the disk arm moves in a circular fashion and this algorithm is also similar to SCAN algorithm and hence it is known as C-SCAN (Circular SCAN).
Advantages:
1) Provides more uniform wait time compared to SCAN.
Illustration on CSCAN
LOOK
It is similar to the SCAN disk scheduling algorithm except for the difference that the disk arm in spite of going to the end of the disk goes only to the last request to be serviced in front of the head and then reverses its direction from there only. Thus it prevents the extra delay which occurred due to unnecessary traversal to the end of the disk.
Advantages:
1) Better version of scan.
Illustration on LOOK
CLOOK
As LOOK is similar to SCAN algorithm, in similar way, CLOOK is similar to CSCAN disk scheduling algorithm. In CLOOK, the disk arm in spite of going to the end goes only to the last request to be serviced in front of the head and then from there goes to the other end’s last request. Thus, it also prevents the extra delay which occurred due to unnecessary traversal to the end of the disk.
Advantages:
1) Better version of cscan.
Illustration on CLOOK