0% found this document useful (0 votes)
7 views16 pages

Disk Scheduling Algorithms Overview

The document discusses various disk scheduling algorithms used in operating systems, including FCFS, SSTF, SCAN, and C-SCAN. It highlights the importance of efficient disk scheduling to optimize performance, reduce access time, and improve system efficiency. Each algorithm is explained with its advantages and disadvantages, emphasizing the trade-offs involved in their implementation.

Uploaded by

singhshobhit8077
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views16 pages

Disk Scheduling Algorithms Overview

The document discusses various disk scheduling algorithms used in operating systems, including FCFS, SSTF, SCAN, and C-SCAN. It highlights the importance of efficient disk scheduling to optimize performance, reduce access time, and improve system efficiency. Each algorithm is explained with its advantages and disadvantages, emphasizing the trade-offs involved in their implementation.

Uploaded by

singhshobhit8077
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

Topic :-Disk Scheduling Algorithms in


Operating Systems (FCFS, SSTF, SCAN & C-
SCAN)

Shobhit Kumar
Qid:-23030620
2
Introduction:-Disk Scheduling Algorithms
Disk scheduling algorithms manage how data is read from and written
to a computer's hard disk. These algorithms help determine the order
in which disk read and write requests are processed

Disk scheduling is also known as I/O Scheduling


The main goals of disk scheduling are to optimize the performance
of disk operations, reduce the time it takes to access data and
improve overall system efficiency.
Common disk scheduling methods include First-Come, First-Served
(FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, LOOK, and
C-LOOK.
3
Importance of Disk Scheduling
Multiple I/O requests arrive from different processes.
Disk controller handles only one request at a time.
Remaining requests wait in a queue and must be scheduled
efficiently.
Requests may be far apart on the disk, increasing head
movement.
Hard disk is a slow device, so efficient scheduling is essential.

4
Seek Time: Time taken to move the disk arm to the track where
data is located.
Rotational Latency: Time taken for the desired sector to rotate
under the read/write head.
Transfer Time: Time taken to actually read or write the data,
depending on disk speed and data size. 5
Goals of Disk Scheduling Algorithms
Minimize Seek Time
Maximize Throughput
Minimize Latency
Ensuring Fairness
Efficiency in Resource Utilization

6
Disk Scheduling Algorithms
FCFS (First Come First Serve)
SSTF (Shortest Seek Time First)
SCAN
C-SCAN
LOOK
C-LOOK
RSS (Random Scheduling)
LIFO (Last-In First-Out)
N-STEP SCAN
F-SCAN

7
1. FCFS (First Come First Serve)
FCFS is the simplest of all Disk Scheduling Algorithms. In FCFS, the
requests are addressed in the order they arrive in the disk queue.
Let us understand this with the help of an example.

So, total overhead movement (total distance covered by the disk


arm) =
(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16)
=642

8
Advantages of FCFS
Here are some of the advantages of First Come First Serve.
Every request gets a fair chance
No indefinite postponement

Disadvantages of FCFS
Here are some of the disadvantages of First Come First Serve.
Does not try to optimize seek time
May not provide the best possible service

9
2. SSTF (Shortest Seek Time First)
In SSTF (Shortest Seek Time First), requests having the 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

10
Advantages of Shortest Seek Time First
Here are some of the advantages of Shortest Seek Time First.
The average Response Time decreases
Throughput increases

Disadvantages of Shortest Seek Time First


Here are some of the disadvantages of Shortest Seek Time First.
Overhead to calculate seek time in advance
Can cause Starvation for a request if it has a higher seek time as
compared to incoming requests
The high variance of response time as SSTF favors only some
requests
11
SCAN (Elevator Algorithm)
Disk arm moves in one direction, servicing all requests in its path.
After reaching the end of the disk, it reverses direction and serves
remaining requests.
Works like an elevator (up → down).
Example:
Requests: 82, 170, 43, 140, 24, 16, 190
Initial Head Position: 50 (Moving towards larger value)
Total Head Movement:
(199 − 50) + (199 − 16) = 332

12
Advantages:
✅ High throughput
✅ Low response time variance
Disadvantage:
❌ Long waiting time for requests just passed by the head

0 ---------------------------- 199
| 16 24 43 [50] 82 140 170 190 |
Head moves → → → → → → then ← ← ←
(Elevator Movement)

13
C-SCAN (Circular SCAN)
Working:
Disk arm moves in one direction only.
After reaching the end, it jumps back to the
start (0) without servicing.
Then starts again in the same direction.
Movement is circular.
Example:
Total Head Movement:
(199 − 50) + (199 − 0) + (43 − 0) = 391
Main Advantage:
✅ More uniform waiting time for all requests
14
Diagram
0 ---------------------------- 199
| 16 24 43 [50] 82 140 170 190 |
Head moves → → → → → → then jumps to 0 → → →
(Circular Movement)

15
THANK YOU

16

You might also like