1,923 views
1 votes
1 votes

Disk requests come in to the disk driver for cylinders $10, 22, 20, 2, 40, 6,$ and $38,$ in that order. A seek takes $6\: msec$ per cylinder. How much seek time is needed for

  1. First-come, first served.
  2. Closest cylinder next.
  3.  Elevator algorithm (initially moving upward).

In all cases, the arm is initially at cylinder 20.

1 Answer

Best answer
2 votes
2 votes

Answer:

  1. $876\;\text{sec}$
  2. $360\;\text{msec}$
  3. $348\;\text{msec}$

Explanation:

The order for FCFS: 

$20\rightarrow10\rightarrow22\rightarrow20\rightarrow2\rightarrow40\rightarrow6\rightarrow38$

$\therefore$Distance $=10+12+2+18+38+34+32 = 146 \;\text{cylinders}$

$\therefore $Time $=146\times 6 = 876\;\text{sec}$

 

The order for CCN(SSTF):

$20\rightarrow20\rightarrow22\rightarrow10\rightarrow6\rightarrow2\rightarrow38\rightarrow40$

$\therefore $Distance$=0+2+12+4+4+36+2 = 60\;\text{cylinders}$

$\therefore $Time$=60\times 6 = 360 \;\text{msec}$

 

The order for Elevator(SCAN):

$20\rightarrow20\rightarrow22\rightarrow38\rightarrow40\rightarrow10\rightarrow6\rightarrow2$

$\therefore $Distance: $=0+2+16+2+30+4+4 = 58 \;\text{cylinders}$

$\therefore$ Time $=58\times6 = 348\;\text{msec}$

edited by

Related questions

0 votes
0 votes
1 answer
1
admin asked Oct 28, 2019
808 views
A slight modification of the elevator algorithm for scheduling disk requests is to always scan in the same direction. In what respect is this modified algorithm better th...
0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
3