8k 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__________.

edited | 8k 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
Typo in question- "consider a disk queue..."
0

Can anyone please tell why the answer is not 338 but 346, As For C-Look the first step should be from

63--->47 rather than 63--->87 as it is a shorter distance than going to 87. Please reply.

$63 \rightarrow 191 = 128$
$191 \rightarrow 10 = 181$
$10 \rightarrow 47 = 37$
Total $= 346$
by Loyal (9.7k points)
edited by
–16
+21
@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
+16

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.
+10
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
I think for C SCAN it shall start from 0 again
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

+1
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..
+2

@Sourajit25 @Hirak
"The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. "

hope that helps

0
In CSCAN head traverses the disk and till the final end of the disk and without reversing back(R/W) (just like in SCAN)the head goes to the beginning of the disk without servicing requests in the return round.Thats how it works.

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.

by Loyal (8.3k points)
+3
much needed.. support..

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
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?
+3
Because this is c-Look not C-scan

We can use this method

by Active (4.7k points)

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

by Loyal (9.3k 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!!

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.

by (479 points)
by (457 points)