Home Common Problem What are the disk scheduling algorithms?

What are the disk scheduling algorithms?

Jul 21, 2022 pm 03:27 PM
Disk scheduling algorithm

Disk scheduling algorithms include: 1. First come, first served algorithm, scheduling is performed according to the order in which the process requests access to the disk; 2. Shortest search time priority algorithm, the track selected for scheduling is the distance from the track where the current head is located The nearest track to minimize each search time; 3. Scanning algorithm, select the request closest to the track where the current head is located in the current moving direction of the magnetic head as the next service object; 4. Loop scanning algorithm, in the scanning algorithm On the basis of stipulating that the magnetic head moves in one direction to provide services, when returning, it moves directly to the starting end quickly without serving any requests.

What are the disk scheduling algorithms?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Disk Scheduling In a multi-programmed computer system, each process may continuously make different requests for read/write operations on the disk. Because sometimes these processes can send requests faster than the disk can respond, it is necessary to create a waiting queue for each disk device.

Commonly used disk scheduling algorithms

First come, first served algorithm

FCFS algorithm is based on process requests Scheduling is performed in the order in which disks are accessed. This is the simplest scheduling algorithm. The advantage of this algorithm is its fairness. If only a small number of processes need access, and most requests access clustered file sectors, good performance is expected; but if there are a large number of processes competing for disk use, the performance of this algorithm is often close to random scheduling. . Therefore, some more complex scheduling algorithms are considered in actual disk scheduling.

  • Algorithm idea: serve access requests in the order they arrive.

  • Advantages: Simple and fair.

  • Disadvantages: The efficiency is not high. Two adjacent requests may cause the cylinder seek from the innermost to the outermost, causing the head to move repeatedly, increasing the service time, and also affecting the machine. unfavorable.

Shortest search time first algorithm

The SSTF algorithm selects the track for scheduling processing that is closest to the track where the current head is located, so that each The search time is the shortest. Of course, always choosing the minimum search time does not guarantee the minimum average search time, but it can provide better performance than the FCFS algorithm. This algorithm will produce a "starvation" phenomenon.

  • Algorithm idea: Prioritize access requests closest to the current head for service, mainly considering seek priority.

  • Advantages: Improved disk average service time.

  • Disadvantages: Some access requests may not be serviced due to long waits.

Scan algorithm (also known as elevator algorithm)

The SCAN algorithm selects the request closest to the track where the current head is located in the current moving direction of the head. as the object of the next service. Since the head movement pattern is similar to that of an elevator, it is also called an elevator scheduling algorithm. The SCAN algorithm is not fair to recently scanned areas, therefore, it is not as good as the FCFS algorithm and SSTF algorithm in terms of access locality.

Algorithm idea: When the device has no access request, the magnetic head does not move; when there is an access request, the magnetic head moves in one direction, serving the access requests encountered during the movement [2], and then Determine whether there are still access requests in this direction, and if so, continue scanning; otherwise, change the movement direction and serve passing access requests, and so on. As shown in the figure below:

What are the disk scheduling algorithms?

The head movement trajectory of the scanning algorithm (elevator algorithm)

  • Advantages: Overcoming the shortest seek priority The shortcomings of the method take into account both the distance and the direction.

Cyclic scanning algorithm

Based on the scanning algorithm, it is stipulated that the magnetic head moves in one direction to provide services, and when returning, it moves directly to the starting end quickly without serving any requests. Since the SCAN algorithm prefers to process access requests close to the innermost or outermost tracks, the improved C-SCAN algorithm is used to avoid this problem.

When using the SCAN algorithm and the C-SCAN algorithm, the magnetic head always strictly follows the movement from one end of the disk to the other end. Obviously, it can be improved in actual use, that is, the magnetic head movement only needs to reach the farthest end. A single request can be returned without reaching the disk endpoint. This form of SCAN algorithm and C-SCAN algorithm is called LOOK and C-LOOK scheduling. This is because they look to see if there is a request before moving in a given direction. Note that unless otherwise specified, the SCAN algorithm and C-SCAN algorithm can also be scheduled as LOOK and C-LOOK by default.

Supplement: Comparison of various algorithms


##Advantages
Disadvantages
FCFS algorithm
Fair and simple
The average seek distance is large and should only be used in situations with less disk I/O
SSTF algorithm
Performance is better than "first come, first served"
The shortest average seek time cannot be guaranteed, and "starvation" may occur
SCAN algorithm
The seeking performance is better and can avoid the "starvation" phenomenon
No Conducive to access requests far away from the end of the disk head
C-SCAN algorithm
Eliminates the inconsistency of track requests at both ends Fair
--

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What are the disk scheduling algorithms?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to reset a Lenovo laptop? How to reset a Lenovo laptop? Aug 22, 2025 pm 02:02 PM

ToresetyourLenovolaptop,useWindowsRecoveryforasoftwarereset,AdvancedStartupforunstablesystems,ahardresettoresolvepowerissues,ortheLenovoRecoveryPartitiontorestorefactorysettings.Choosebasedonyourneedsandsystemcondition.

The computer's system tray icon is messy, how to organize it? The computer's system tray icon is messy, how to organize it? Aug 21, 2025 pm 08:12 PM

Hide the system tray icon without affecting the program operation, only removes the visual display; 2. Completely clean up and disable non-essential startup items through the task manager; 3. Resolve the mess and uninstall the software and develop the habit of canceling the bundling and checking during installation, so as to achieve the dual goals of visual refreshing and resource optimization.

Phone not ringing for incoming calls Phone not ringing for incoming calls Aug 08, 2025 am 10:43 AM

Checkifsilentmodeisenabled—flipthering/silentswitchoniPhoneoradjustvolumesettingsonAndroidtoensuretheringerison.2.VerifyDoNotDisturborFocusModeisn’tactiveandreviewsettingstoallowcallsfromcontacts.3.Confirmthecallerisn’tblockedandcallforwardingisdisab

What's wrong with the phone calling without sound What's wrong with the phone calling without sound Aug 13, 2025 pm 06:09 PM

The reasons why there is no sound on the phone call include: hardware problems (damaged speakers, blocked earpiece holes, poor connector contact), software problems (volume setting too low, silent mode is turned on, system failure), network problems (weak signal strength, network congestion), and other reasons (Bluetooth headsets are connected, application interference). Solutions include: checking the hardware, adjusting the volume settings, turning off the silent mode, restarting the phone, updating the system, disconnecting the Bluetooth headset, and uninstalling the problematic application. If it still cannot be solved, please contact technical support.

How to Search for a Word in a PDF Document? How to Search for a Word in a PDF Document? Aug 06, 2025 am 08:29 AM

TosearchforawordinaPDF,firstensurethePDFistext-based;ifnot,useOCRtoconvertit.1.OnWindows,openthePDFandpressCtrl Ftoopenthesearchbar,typetheword,andviewhighlightedresults.2.OnMac,pressCmd FinappslikePrevieworAdobeAcrobattosearch.3.InAdobeAcrobatReader

Haitang Literature City Official Website 2025 Latest Entrance/Haitang Culture Online Entrance Free Summary Haitang Literature City Official Website 2025 Latest Entrance/Haitang Culture Online Entrance Free Summary Aug 12, 2025 pm 09:42 PM

The official entrance of Haitang Literature City, a must-have for novel lovers! Still looking for the entrance to Haitang Literature City? This article brings together the official website of Haitang Literature City and multiple alternate addresses for your quick access. Official and alternate entrance of Haitang Literature City: Official website: https://www.haitbook.com Alternate address 1: https://www.htlvbooks.com Alternate address 2: https://www.longmabookcn.com Alternate address 3: https://www.myhtebook.com More Haitang Literature City Sites: The following lists multiple Haitang Literature City sites for you to choose from: Haitang Site 10: https

What's wrong with calling on a mobile phone without sound? What's wrong with calling on a mobile phone without sound? Aug 13, 2025 pm 06:06 PM

The reasons why Huawei phone calls without sound are: earpiece failure, software failure, network problems and physical damage. For earpiece failures, you can try cleaning the earpiece or contact after-sales repair; for software failures, you can update the system or uninstall suspicious applications; for network problems, you can move to a good signal area or contact the network supplier; for physical damage, you need to contact after-sales repair or replace components.

How to Add Headers and Footers to a PDF? How to Add Headers and Footers to a PDF? Aug 11, 2025 am 11:04 AM

UseAdobeAcrobatProforprecisecontrolbynavigatingtoTools>EditPDF>Header&Footer>Add,insertingtextorplaceholderslike&[Page]and&[Pages],customizingappearance,andapplyingtospecificpages.2.Forquickresults,usefreeonlinetoolssuchasSejdaby