0
$\begingroup$

I have a system where disk requests come to a disk drive for cylinders in the order 10, 22, 20, 2, 40, and 38 at a time when the disk drive is reading from cylinder 20. The seek time is 6ms per cylinder. I have to find total seek time if the disk scheduling algorithm is First-Come-First-Serve (FCFS).

To find the answer I used a formula:

total seek time=0.254*sqrt(d)(for each cylinder and sum them)

But that gave the incorrect result. What formula(s) should I be using to handle questions like this?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

@tonny, I am also found this example from a book, I think the number 6 is missed after the number 40 in the example. The correct order is 10, 22, 20, 2, 40, 6 and 38. So if it starts from cylinder 20, You can write it as, -> (20), 10, 22, 2, 40, 6, 38 -> (20-10)+(10-22)+(22-2)+(2-40)+(40-6)+(6-38) -> 10+12+20+38+34+32 -> 146. So seek time is = 146*6 876 ms.

$\endgroup$
1
  • 2
    $\begingroup$ Thanks for clearing up the missing value from the question. It would probably be useful to state which book this is. $\endgroup$ Commented Feb 10, 2016 at 15:58
0
$\begingroup$

You state that the seek time is 6ms per cylinder. That means: take the distance (in cylinders) that you move and multiply it by 6ms.

You are starting on cylinder 20, then moving to cylinder 10: that is 20-10=10 cylinders difference, so 6ms*10 = 60ms. Then you move from cylinder 10 to cylinder 22: that is 22-10=12 cylinders difference, so another 6ms*12 = 72ms. And so on.

$\endgroup$
6
  • $\begingroup$ my book has direct solution which says: the disk drive has to traverse totally 146 cylinders and then 146*6=876 ms.but how 146 ? $\endgroup$
    – tonny
    Commented Oct 18, 2014 at 16:33
  • $\begingroup$ @tonny. I can think of three reasons. (1) The book's solution is wrong, (2) you miscopied the problem, or (3) the book is using some nonstandard version of FCFS. $\endgroup$ Commented Oct 18, 2014 at 17:48
  • $\begingroup$ Moving the suggested way gives 492 ...is it right then? @RickDecker $\endgroup$
    – tonny
    Commented Oct 18, 2014 at 18:19
  • $\begingroup$ out of the three reasons only 1 or 3 may be valid $\endgroup$
    – tonny
    Commented Oct 18, 2014 at 18:20
  • $\begingroup$ @tonny. I'd agree with 492 as an answer. You'd almost get the book's answer if you added all the cylinder numbers. If I had to guess, I'd say that the answer was wrong. I know from much experience that answering questions, even ones that I made up, is fraught with errors. $\endgroup$ Commented Oct 18, 2014 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.