The Gateway to Computer Science Excellence
+35 votes
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__________.
in Operating System by Loyal (7.2k points)
edited by | 8k views
why you reopened this question.
I dnt know in what way he/she asked so i reopened

If not close that question

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

 sid1221 yes u r right .thnq

Typo in question- "consider a disk queue..."

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. 

7 Answers

+59 votes
Best answer
$63 \rightarrow 191 = 128$
$191 \rightarrow 10 = 181$
$10 \rightarrow 47 = 37$
Total $= 346$
by Loyal (9.7k points)
edited by
Here that jump is considered
here too its considered
this is from IITB.
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..

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..

pic 1

pic 2

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

plz provide the link of solution of gelvin 7th edition......

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?
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.
nearly everyone gives as reference for  disk scheduling algorithms and it's given wrong there.
someone please clear this query
I think for C SCAN it shall start from 0 again
please clear!
C-SCAN should be 9855.

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

Even the method given in this wikipedia link is wrong 

How to determine the direction?

Why it can't be :

$63 - 10 = 53$

$191 - 10 = 181$

$191 - 87 = 104$

Total head movement$ = 338$ ??
I have the same doubt..

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

hope that helps

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.
+29 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.

by Loyal (8.3k points)
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
by (155 points)
edited by
Why? that is not considered?? and i think you have implemented LOOK and not CLOOK..

Sorry. I was wrong. I had modified my answer with CLOOK algorithm.


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

We can use this method 

by Active (4.7k points)
+2 votes

Answer is 346.

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

by Loyal (9.3k points)
but in gate key i guess answer is 165(u can check geeksforgeeks)
Thats wrong. Answer cannot be 165 in any way.
thanks for the confirmation :)
–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.


by (479 points)
–3 votes
Refer bootstrapper youtube videos on youtube all doubts will be cleared
by (457 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,833 questions
57,689 answers
107,287 users