in CO and Architecture edited by
401 views
5 votes
5 votes

At a particular point in time, the buffer cache has dirty data that needs to be flushed to disk. Suppose that the identities of these blocks can be listed in [track:sector] form as follows:
$$[10:5], [22:9], [11:6], [2:10], [20:5], [32:4], [32:5], [6:7]$$
Assume that the disk head is currently positioned over track $20.$

Which of the following disk scheduling algorithms yield the following sequence of writes:
$$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$$

  1. Shortest Seek Time First
  2. Scan (initially moving upwards)
  3. Look (initially moving upwards)
  4. C-SCAN (initially moving upwards)
in CO and Architecture edited by
401 views

4 Comments

I feel only option A and C are viable, as for SCAN to be correct we need to know the upper bound of the tracks, here there is no mentioning about how many maximum tracks are there in the disk so currently we can't directly assume the last request as the largest track right?
7
7

upper bound of number of tracks in not given therefore scan must not be a viable option here @GO Classes

0
0
still confusion here because I think upper and lower bound are present by default...but as GO answer says "in particular condition" then we can accept
0
0
I think they are asking yeilding only,the order in which the following tracks will be discovered
0
0

1 Answer

3 votes
3 votes
Shortest Seek Time First:

$$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$$

In breaking the tie between $[32:4]$ and $[32:5], $ we picked sector order, so that we can pull them consecutively from disk without extra rotations.

Scan (initially moving upwards):

$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$

In this particular case, notice that both SSTF and Scan yield the same result.
edited by
Answer:

Related questions