First-Come-First-Served (FCFS)
The first-come-first-served (FCFS) algorithm is designed to handle requests in the order they are received, regardless of where the head is located within the disk drive. Even though this is most fair algorithm out of the three, it is also the least efficient. The graph below shows how inconsistently the head had to travel in order to serve the requests that were being sent.
The first-come-first-served (FCFS) algorithm is designed to handle requests in the order they are received, regardless of where the head is located within the disk drive. Even though this is most fair algorithm out of the three, it is also the least efficient. The graph below shows how inconsistently the head had to travel in order to serve the requests that were being sent.
Shortest-Seek-Time-First (SSTF)
The shortest-seek-time-first algorithm aims to handle requests with the shortest seek time from the current head location. This algorithm surprised me as I thought it was going to be more efficient than the FCFS algorithm. As shown in the graph, this algorithm was performing very well until a request was sent at cylinder 17. In this case the head waited to serve the request at cylinder 17 until very last which forced the head to travel a long distance.
SCAN
The SCAN algorithm handles requests by moving the arm from one end of the cylinder to the other and vice versa. This algorithm was by far the most efficient out of the three as it had an overall less distance to travel when handling the requests. Overall, if it were up to me, I would want to use the SCAN system on my personal computer to fulfill any requests my system may have. I think that regardless of which requests were being sent, that this algorithm would still be the most efficient overall.
As stated above, the First-Come-First-Served algorithm is, and will always be, the fairest algorithm as it processes the requests in the order they are received regardless of time or where the head is at on the cylinders. Overall, I would say that the algorithms are only as efficient as the data that is being entered. I can easily see how one algorithm may be more efficient than another depending on the requests that are sent as well as where the head is positioned on the cylinder.
An example of when the operating system being fair would be important would be when multiple programs were being used at once and each one had the same priority level. In this example the user would need to know that the programs are sharing the disk writing ability and that would not matter to the user. Also, I would think that the programs would have to be on the same page as far as the number of resources being used so that one program would not be bottlenecking another.
An example of when the operating system being unfair would be important would be when there is a priority set to a specific program. Often a user will set priority to certain programs so that they may use resources quicker or more often than other programs. In an example like this the user would know which program they want to have written to the disk before the others.
References:
Silberschatz, A., Galvin, P.B., & Gagne, G. (2014). Operating System Concept Essentials (2nd ed.). Retrieved from https://redshelf.com/
Silberschatz, A., Galvin, P.B., & Gagne, G. (2014). Operating System Concept Essentials (2nd ed.). Retrieved from https://redshelf.com/
Comments
Post a Comment