Disk Scheduling algorithm __ algorithm

Source: Internet
Author: User

First Comes first service algorithm (FCFS), shortest seek time priority algorithm (SSTF), scanning algorithm (SCAN), cyclic scanning algorithm (Cscan)

1, first come first service algorithm (FCFS)

This is a relatively simple disk scheduling algorithm. It is scheduled according to the order in which the process requests access to the disk. The advantage of this algorithm is fair, simple, and each process request can be processed in turn, without the occurrence of a process request for a long time not satisfied. This algorithm can reduce the throughput of the equipment service, and the average seek time may be longer, but the response time of each process is smaller because of the lack of optimization of the seek path and the more access requests to the disk.

2. Shortest seek Time Priority algorithm (SSTF)

The algorithm chooses such a process that the track that is required to access is the closest to the track of the current magnetic head, so that the shortest seek time is obtained, the algorithm can get better throughput, but it can't guarantee the shortest seek time. The disadvantage is that the response time of the user's service request is not equal, thus resulting in a large change in response times. In the case of many service requests, requests for internal and external edge tracks will be deferred indefinitely, and some requests will not be expected to respond.

3, scanning algorithm (SCAN)

The scanning algorithm takes into account not only the distance between the track to be accessed and the current track, but also the current moving direction of the head. For example, when the head is moving outward from the inside, the next object that the scan algorithm chooses should be the track that it wants to access, both outside the current track and the nearest. This way from the inside to the field, until no more external tracks need to be accessed before the magnetic arm commutation, from the outward moving. At this point, the same process is also selected each time to schedule, that is, the track to access, within the current track, so as to avoid the emergence of hunger phenomenon. Because the law of the magnetic head movement in this algorithm is quite like the elevator operation, it is also called elevator scheduling algorithm. This algorithm basically overcomes the shortcoming that the service of the shortest seek time priority algorithm is concentrated in the intermediate track and the response time change is larger, the advantage of the shortest seek time priority algorithm is that the throughput is large, the average response time is small, but because it is a swing-type scanning method, the frequency of both tracks is still lower than the intermediate track.

4. Cyclic scanning algorithm (Cscan)

The cyclic scanning algorithm is an improvement to the scanning algorithm. If the access request for the track is evenly distributed, the access request is relatively small when the head reaches one end of the disk and the head is dropped when the movement is reversed. This is because these tracks have just been processed, and the request density on the other side of the disk is very high, and these access requests wait longer, in order to solve this situation, the cyclic scanning algorithm requires the head to move in one direction. For example, moving outward only from the inside, when the head moves to the most visited track, the head immediately returns to the most desired track, and the minimum track number is followed by the maximum track number, which is scanned.

Reprint Address: http://gengning938.blog.163.com/blog/static/128225381201161884614990/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.