Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a disk with n cylinders numbered sequentially 0, 1, 2,…., n-1. The unit

ID: 3855055 • Letter: C

Question

Consider a disk with n cylinders numbered sequentially 0, 1, 2,…., n-1. The unit has just finished servicing requests on cylinder 152 and has moved to cylinder 163. The queue of requests to be serviced is as follows:

            163, 89, 137, 913, 1224, 1248, 1119, 1522, 1653, 139

Where 163 is the oldest request and 139 is the latest arrival.

a) In what order will the cylinders be serviced under the following scheduling policies?

FIFO_________________________________________________________

SSTF_________________________________________________________

SCAN________________________________________________________

b) What will be the distance (number of cylinders) traveled by the R/W head under each policy?

FIFO______________

SSTF______________

SCAN_____________

Explanation / Answer

a) In what order will the cylinders be serviced under the following scheduling policies?

FIFO_First In First Out - All the incoming requests are placed at the end of the queue. Service will be given for the request which is next in the queue.

For this case, the service will be given to a 163, then, 89, next,137, and so on.139 request will be serviced at last. Here the disadvantage is the total number of head moved is very high, and its fair all the request are processed fairly.

Service processing order is First come First serve : 163, 89, 137, 913, 1224, 1248, 1119, 1522, 1653, 139

SSTF Shortest Seek time First . Request is serviced according to next shortest distance so the service order is 163, 137, 139, 913, 1119,1224, 1248, 1522, 1653, 89. After finishing the request of 152, service will be given to 163, and next service to shortest seek time, that is 137, then to 139, 913, 1119,1224, 1248, 1522, 1653. 89 request will be service waits till all the request completes. In this method of seek time has to calculated first, low variance will be processed first. High variance respond time may be longer .

SCAN : In SCAN method, the disk arm moves into a particular direction and services the requests coming in its path and after reaching the end of disk, it reverses its direction and again services the request arriving in its path. So, this algorithm works like an elevator and hence also known as elevator algorithm. In this method, the requests at the midrange are serviced more and those arriving behind the disk arm will have to wait.

Request after 163 is 137,139,913,1119,1224,1248,1522,1653,89.

This method is best method for the request in the middle , but the end has to wait for long time. As in the example 89 request arrives first and wait till all the request completes.

b) What will be the distance (number of cylinders) traveled by the R/W head under each policy?

FIFO_Service processing order is First come First serve : 163, 89, 137, 913, 1224, 1248, 1119, 1522, 1653, 139

From 169 to 89 it moved 80 tracks.

[163-89]+[89-137]+[137-913]+[913-1224]+[1224-1248]+[1248-1119]+[1119-1522]+[1522-1653]+[1653-139]

=74+48+776+311+24+129+403+132+1514

=3411

In this example, it had a total head movement of 3411on the tracks. The disadvantage of this algorithm is noted by the oscillation from track 163 to track 89 and then back to track 89 to 137 then to 913.

next_____________

SSTF the service order is 163, 137, 139, 913, 1119,1224, 1248, 1522, 1653, 89. The total number of tracks to be moved is =[163-137]+[139+137]+[139-913]+[913-1119]+[1119-1224]+[1224-1248]+[1248-1522]+[1522-1653]+[1653-89]

= 26+2+774+206+105+24+274+131+1564

=3106

SCAN the service order is 163 is 137,139,913,1119,1224,1248,1522,1653,89.

The total number of tracks to be moved is :

=[163-137]+[139+137]+[139-913]+[913-1119]+[1119-1224]+[1224-1248]+[1248-1522]+[1522-1653]+[1653-89]

= 26+2+774+206+105+24+274+131+1564

=3106

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote