0% found this document useful (0 votes)
10 views4 pages

1 Document

A

Uploaded by

Waleed Håšhįm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

1 Document

A

Uploaded by

Waleed Håšhįm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Explore the various disk scheduling algorithms used by operating

systems:-

Disk scheduling algorithms are essential for managing how disk I/O
operations are handled by an operating system, especially when
multiple requests are competing for the same disk. These algorithms
aim to optimize the access time and maximize throughput by
determining the order in which disk requests are serviced. Here’s an
overview of the most commonly used disk scheduling algorithms:

1. First-Come, First-Served (FCFS)

Description: The simplest disk scheduling algorithm where requests are


handled in the order they arrive.

Advantages: Easy to implement and ensures a fair approach since all


requests are treated equally.

Disadvantages: Can lead to inefficient processing and high average


wait times, particularly if requests are scattered far apart on the disk.

2. Shortest Seek Time First (SSTF)

Description: Selects the request closest to the current position of the


disk head, minimizing the seek time.

Advantages: Often reduces the average seek time compared to FCFS.

Disadvantages: Can cause starvation for requests that are farther


away, as closer requests are continuously prioritized.
3. SCAN (Elevator Algorithm)

Description: Moves the disk head in one direction, servicing all


requests until it reaches the end, then reverses direction. It acts like an
elevator, going up and down.

Advantages: Reduces the chance of starvation and provides a more


predictable wait time.

Disadvantages: Requests at the far ends might wait longer if they


arrive right after the head has passed their location.

4. C-SCAN (Circular SCAN)

Description: Similar to SCAN, but instead of reversing direction at the


end, the disk head moves back to the beginning and starts scanning
again. It only services requests in one direction.

Advantages: Provides a more uniform wait time since each request is


scanned in a cyclic manner.

Disadvantages: Could be slightly less efficient due to the extra time


taken to return to the starting point.

5. LOOK and C-LOOK


LOOK: Similar to SCAN, but instead of going all the way to the end, the
disk head stops at the last request in each direction.

C-LOOK: Functions like C-SCAN, but only goes as far as the last request
before jumping back to the beginning.

Advantages: These algorithms reduce unnecessary movement by


stopping when there are no more requests in the direction of the scan.

Disadvantages: Like SCAN and C-SCAN, they can be less optimal with
high request loads.

6. N-Step SCAN

Description: Divides the request queue into smaller sub-queues, each


serviced by a separate SCAN cycle. When one batch is being serviced,
new requests are added to the next batch.

Advantages: Helps avoid starvation and distributes service evenly


across requests.

Disadvantages: Additional complexity in managing and grouping


requests into batches.

7. FSCAN
Description: A variation of SCAN that divides requests into two queues.
While one queue is being processed, new requests are added to the
second queue, avoiding starvation.

Advantages: Efficient handling of requests, avoiding starvation and


improving response times.

Disadvantages: Slightly more complex due to the need to manage two


queues.

Each of these algorithms has its own strengths and is chosen based on
specific system requirements. Factors like response time, throughput,
and fairness help determine the most suitable algorithm for a given
scenario.

You might also like