# GATE1989-4-xii

19 votes
2.4k views

Provide short answers to the following questions:

Disk requests come to disk driver for cylinders $10, 22, 20, 2, 40, 6$ and $38$, in that order at a time when the disk drive is reading from cylinder $20$. The seek time is $6$ msec per cylinder. Compute the total seek time if the disk arm scheduling algorithm is.

1. First come first served.
2. Closest cylinder next.

## 2 Answers

25 votes

Best answer
1. In FCFS sequence will be $\Rightarrow 20, 10, 22, 20, 2, 40, 6, 38$
total movement: $|20-10| + |10-22| + |22-20| + |20-2| + |2-40| + |40-6| + |6-38| = 146$
so total seek time $= 146 \times 6 = \mathbf{876 msec}$

2. In Closest cylinder next sequence will be $\Rightarrow 20, 22, 10, 6, 2, 38, 40$
total movement: $|20-22| + |22-2| + |2-40| = 60$
so total seek time $= 60 \times 6 = \mathbf{360 msec}$

edited by
0
For FCFS

In last one |6-40| ?
0
sry thats typo..its |6-38|
0

admin please correct the part B of this answer. same error is in book  !!!

0
What error?
3

@Arjun Sir

For better clarity it should be

Total head movements $= \:\mid 20-22\mid + \mid 22-10\mid + \mid 10-6 \mid + \mid 6 - 2 \mid + \mid 2-38 \mid + \mid 38-40 \mid$

$= 2 + 12 + 4 + 4 + 36 + 2 = 60$

So, total seek time $= 60 \times 6\:msec = 360\:msec$

11 votes

A)FCFS:(20-10) + (22-10) + (22-2) + (40-2) + (40-6) + (38-6) = 146

But seek time is 6ms per cylinder,So total seek time = 146 * 6 = 876.

B)Closest cylinder next:(22-20) + (22-10) + (10-6) + (6-2)  + (38-2) + (40-38) = 60

So total seek time = 60 * 6 = 360.

edited
0

in FCFS 20 should be visited again after 22

in closest cylinder next 22 should be visited from 20

0
20 is not visited again because it is initially at 20.

closest cylinder next ..corrected.
8
in FCFS it doesn't matter its initial position...he follows the sequence without knowing whether he will visit initial position again
so as per the sequence 20 will be visited again
0
AFAIK,your statement is  not correct.
0

Which statement @Prabhanjan_1?

## Related questions

0 votes
0 answers
1
206 views
Provide short answers to the following questions: Consider the following sequence of UNIX commands: grep main a.c b.c c.c > grepout & wc < grepout & rm grepout & Why is this not equivalent to the following? grep main a.c.b.c c.c | wc
3 votes
1 answer
2
976 views
Consider the following precedence graph (Fig.6) of processes where a node denotes a process and a directed edge from node $P_{i}$ to node $P_{j}$ implies; that $P_{i}$ must complete before $P_{j}$ commences. Implement the graph using FORK and JOIN constructs. The actual computation done by a process may be indicated by a comment line.
10 votes
4 answers
3
1.4k views
A system of four concurrent processes, $P, Q, R$ and $S$, use shared resources $A, B$ and $C$. The sequences in which processes, $P, Q, R$ and $S$ ... processes. What strategies can be used to prevent deadlocks in a system of concurrent processes using shared resources if preemption of granted resources is not allowed?
2 votes
1 answer
4
357 views
Provide short answers to the following questions: Express the following list in terms of a linked list structure suitable for internal representation. $(((ab)c)d((e)))$