+31 votes
7.2k views
Cylinder a disk queue with requests for $I/O$ to blocks on cylinders $47, 38, 121, 191, 87, 11, 92, 10.$ The C-LOOK scheduling algorithm is used. The head is initially at cylinder number $63$, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from $0$ to $199$. The total head movement (in number of cylinders) incurred while servicing these requests is__________.
asked
edited | 7.2k views
0
0
why you reopened this question.
0
I dnt know in what way he/she asked so i reopened

If not close that question

sorry
0
but in clook it will go to the end .why we are not conisdering 199 at last point
+3
for c scan/ scan it will go till last track ...
0

sid1221 yes u r right .thnq

0

@Arjun

How to determine the direction?

Why it can't be :

63−10=53

191−10=181

191−87=104

Total head movement=338 ??

## 7 Answers

+55 votes
Best answer
$63 \rightarrow 191 = 128$
$191 \rightarrow 10 = 181$
$10 \rightarrow 47 = 37$
Total $= 346$
answered by Loyal (9.6k points)
edited by
–16
+18
@Mithlesh
http://www2.cs.uregina.ca/~hamilton/courses/330/notes/io/node8.html
Here that jump is considered
https://courses.cs.washington.edu/courses/cse451/04au/section/section7.pdf
here too its considered

https://www.cse.iitb.ac.in/~rkj/cs347m/disk.pdf
this is from IITB.
http://nptel.ac.in/courses/Webcourse-contents/IISc-BANG/Operating%20Systems/pdf/Test_Problems/Mod%205.pdf
This one is from IISC prof's course.. here in problem 5.3 see the answer. if you calculate, youll find here also the long jump is considered.. i dont know why in the link you posted it is said not to consider the long jump..
Logically when the head is at 191.. it has to be moved to 10.. so head has to be moved over 181 tracks..and that should be considered for head movements...

and even in WIlliam Stalings, they have given an example for CSCAN(with look) in that they have considered it has head movement..
–1
+12

I really dont know why its given there like that.. Also it is not a IIT link, it is some Illunosis Institute of Technology..
More proof from Solutions to Galvin 7th edition..

See the f-bonus part.. try to calculate yourself.. youll see the long jump is considered.. PERIOD

0
plz provide the link of solution of gelvin 7th edition......
+3
@abhilashpanicker29

I have one confusion.

In the question 12.2. we have disk cylinders from 0-4999. Head in C-SCAn goes from 143 to 4999. But after Jump it starts from 86. It does not start from 0.

So what is C-SCAN excatly?
+1
Thank you sir. I also read it from the pdfs and various links which are there on Internet but later when I read your comment I directly jumped to the standard book william stalng and found that jump time is included. I don't know why people give video lectures on youtube or upload pdfs when they don't have their concepts clear. Feeling irritated.
+8
nearly everyone gives http://www.cs.iit.edu/~cs561/cs450/disksched/disksched.html as reference for  disk scheduling algorithms and it's given wrong there.
0
someone please clear this query
I think for C SCAN it shall start from 0 again
please clear!
0
C-SCAN should be 9855.

someone plz check?
0
yes u r right. Solution is given wrong.
0
it means we will always consider movement in both csan and clook
0

Even the method given in this wikipedia link is wrong

0
How to determine the direction?

Why it can't be :

$63 - 10 = 53$

$191 - 10 = 181$

$191 - 87 = 104$

Total head movement$= 338$ ??
0
I have the same doubt..
+27 votes

Answer is 346 as already calculated in answers here.Those having some doubt regarding long jump ,check this image, Now in question Total Head Movements are asked,When Head reaches  any End, There is no mechanism for head to jump directly to some arbitrary track.It has to Move.So it has to move along the tracks to reach Track Request on other side.Therefore head will move and we must count it.

since purpose of disk scheduling algorithms is to reduce such Head movements by finding an Optimal algorithm.If you ignore the move which is actually happening in disk,that doesn't serve the purpose of analyzing the algorithms.

answered by Loyal (8.1k points)
+3
much needed.. support..
+19 votes
Answer is 346.

63 -> 87 = 24

87 -> 92 = 5

92 -> 121 = 29

121 -> 191 = 70

191 -> 10 = 181

10 -> 11 = 1

11 -> 38 = 27

38 -> 47 = 9

Total: 24+5+29+70+181+1+27+9 = 346
answered by (155 points)
edited by
0
Why? that is not considered?? and i think you have implemented LOOK and not CLOOK..
+2
@abhilash

Sorry. I was wrong. I had modified my answer with CLOOK algorithm.
0
191->199

199->0

why these two are eliminated?
+2
Because this is c-Look not C-scan
+2 votes

Answer is 346.

In CSCAN, we have a longer jump, from one end of disk to the other.

answered by Loyal (9.2k points)
0
but in gate key i guess answer is 165(u can check geeksforgeeks)
0
Thats wrong. Answer cannot be 165 in any way.
+3
0
thanks for the confirmation :)
0
Anytime!!
+1 vote

We can use this method

answered by Active (4.1k points)
–3 votes

Ans is 165 that huge jump in C-LOOK and C-SCAN doesn't count. That's why it's circular-LOOK and Circular-SCAN.

answered by (455 points)
–3 votes
Refer bootstrapper youtube videos on youtube all doubts will be cleared
answered by (441 points)
Answer:

+33 votes
8 answers
1
+16 votes
3 answers
2
+31 votes
7 answers
3
+41 votes
18 answers
4
+51 votes
14 answers
5
+51 votes
6 answers
6
+35 votes
8 answers
7