in Operating System
1,937 views
1 vote
1 vote

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.

in Operating System
by
1.9k views

1 Answer

2 votes
2 votes
Best answer

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
by

1 comment

Closest Cylinder Next(CCN) is similar to Shortest Seek Time First(SSTF).
1
1

Related questions