in Operating System recategorized by
86,578 views
18 votes
18 votes
The head of a moving head disk with $100$ tracks numbered $0$ to $99$ is currently serving a request at track $55$. If the queue of requests kept in FIFO order is $$10, 70, 75, 23, 65$$
which of the two disk scheduling algorithms FCFS (First Come First Served) and SSTF (Shortest Seek Time First) will require less head movement? Find the head movement for each of the algorithms.
in Operating System recategorized by
86.6k views

4 Comments

It is given that input is in queue. SSTF will require all at once.
0
0
If the queue of requests kept in FIFO order -> then how can SSTF know 65 is closer to 55? If we get elements one by one from the queue, then will SSTF be different from FCFS?
0
0

FCFS : 55→10→70→75→23→65 ⇒ 45+60+5+52+42=204.

           55→10→70→75→23→65 ⇒ 45 + 40 + 5 + 48 + 42 = 190.

SSTF : 55→65→70→75→23→10⇒10+5+5+52+13=85

            55→65→70→75→1023⇒10+5+5+35+13= 68

I think there is some problem with above answer.

Can anyone verify this ?

0
0

Piyush In SSTF, the ordering of the queue doesn’t matter. It will always pick the least seek time. 

0
0

1 Answer

33 votes
33 votes
Best answer

FCFS : $55 \rightarrow10 \rightarrow70 \rightarrow 75 \rightarrow 23 \rightarrow 65 \Rightarrow 45+60+5+52+42=204.$

SSTF : $55 \rightarrow 65 \rightarrow 70 \rightarrow 75 \rightarrow 23 \rightarrow 10 \Rightarrow  10+5+5+52+13=85$

Hence, SSTF.

edited by

3 Comments

You had missed 10 for SSTF, I have added that :)
9
9
If the queue of requests kept in FIFO order -> then how can SSTF know 65 is closer to 55? If we get elements one by one from the queue, then will SSTF be different from FCFS?
0
0
edited by

@Arjun @Sachin Mittal 1 Sir should’nt the answer for FCFS and SSTF be same because we are using a queue so for SSTF how can we know which next cylinder will give minimum number of head movements ??

0
0

Related questions