Disk Scheduling Algorithm ~Operating System

Prince Prajapati
0

What is Disk Scheduling Algorithm?

Disk Scheduling Algorithms are algorithms used to manage input and output requests for a disk in a system. The goal of these algorithms is to minimize the total seek time, which is the time taken to position the disk arm to the requested track for reading or writing data.


Seek Time: Seek time is the duration required to position the disk arm at a specific track where data needs to be read from or written to. The efficiency of a disk scheduling algorithm is often measured by its ability to minimize the average seek time.


Rotational Latency: Rotational latency, on the other hand, refers to the time it takes for the desired sector of the disk to rotate into a position where it can be accessed by the read/write heads. A disk scheduling algorithm that minimizes rotational latency is considered advantageous.

Transfer Time: Transfer time is the time to transfer the data This is affected by factors such as the rotational speed of the disk and the size of the data being transferred.

Disk Access Time: Disk Access Time is:

Disk Access Time = Seek Time + Rotational Latency + Transfer Time

Total Seek Time = Total head Movement Seek Time


Disk Scheduling Algorithm

There are several disk scheduling algorithms commonly used:


1. FCFS (First-Come, First-Served): This is the simplest disk scheduling algorithm where requests are executed in the order they arrive in the disk queue.


2. SSTF (Shortest Seek Time First): In SSTF, the request with the shortest seek time is executed first. The seek time of each request is calculated in advance, and the request with the shortest seek time is scheduled next. This algorithm reduces the average response time and increases system throughput compared to FCFS.


3. SCAN: In SCAN, the disk arm moves in a specific direction, servicing requests along its path. Upon reaching the end of the disk, it reverses direction and services requests in the opposite direction. This algorithm, also known as the elevator algorithm, prioritizes requests in the midrange, potentially causing delays for requests behind the disk arm.


4. CSCAN (Circular SCAN): CSCAN is similar to the SCAN algorithm, but instead of reversing direction, the disk arm moves to the other end of the disk and starts servicing requests from there. This circular fashion of movement prevents the issue of too many requests waiting at one end or having zero or few pending requests at the scanned area.


5. LOOK: LOOK is similar to the SCAN algorithm, but instead of going to the end of the disk, the disk arm only goes to the last request to be serviced in front of the head and then reverses direction from there. This avoids the unnecessary traversal to the end of the disk, reducing delay.


6. CLOOK (Circular LOOK): CLOOK is similar to CSCAN, where the disk arm goes only to the last request to be serviced in front of the head and then moves to the other end's last request. It prevents the extra delay caused by unnecessary traversal to the end of the disk.


These disk scheduling algorithms aim to optimize the order in which disk requests are serviced, reducing the overall seek time and improving disk performance.

Post a Comment

0Comments

Post a Comment (0)