sleeping during a precise time interval

R

Richard Bos

A busy loop of a few microseconds doesn't look very expensive in CPU
time to me...

Let me inform you then that, as a sysadmin, I'd prefer that you do not
recommend anyone to busy-wait on any multi-user system no matter how
cheap it looks to you; and that, if I find one of your programs doing
so, it'll be off the system in no time flat, and none of your other
programs will ever get near it from then on.

Richard
 
R

Richard Bos

jacob navia said:
The best way is to use the time stamp counter register in the CPU
if you are running an intel-compatible machine

The instruction RDTSC will leave in EAX:EDX a 64 bit counter

Fantastic. Not only is it off-topic and inaccurate, it doesn't actually
answer the question in a useful way. You're cute, jacob.

Richard
 
A

Alan Balmer

The best way is to use the time stamp counter register in the CPU
if you are running an intel-compatible machine
You are in the wrong newsgroup. Furthermore, your answer is
incomplete, potentially misleading, and quite likely downright wrong.
The previous comments are about all that can be said in this group.
The OP should go to a more appropriate newsgroup - one for his
hardware/OS or perhaps comp.arch.embedded, where he will find people
who do this sort of thing for a living.
 
C

Christopher Benson-Manica

Richard Bos said:
Fantastic. Not only is it off-topic and inaccurate, it doesn't actually
answer the question in a useful way. You're cute, jacob.

I rather prefer the original:

"This is a wonderful answer. It's off-topic, it's incorrect, and it
doesn't answer the question."
 
R

Randy Howard

I rather prefer the original:

"This is a wonderful answer. It's off-topic, it's incorrect, and it
doesn't answer the question."

Then credit it properly. Wasn't it Richard Heathfield that said
that? IIRC that is the case.
 
C

Christopher Benson-Manica

Randy Howard said:
Then credit it properly. Wasn't it Richard Heathfield that said
that? IIRC that is the case.

Yes; I figured it was well-known enough in these circles that an
attribution wasn't necessary. My apologies to Mr. Heathfield :)
 
M

Mark McIntyre

Is it only me that finds it slightly concerning that a compiler
implementor doesn't know where to find the specs of the chip being
supported?

Were you surprised at all, then? This is normal for that particular
compiler suite.[/QUOTE]

Frankly, yes I was, as Jacob, though frequently bl**dy annoying in
CLC, strikes me as a fairly careful person who probably tries to do
the job properly.

I guess there's arcanity that we all don't know. Hands up who
remembers all the digraphs? no peeking now!
 
J

jacob navia

Mark said:
Were you surprised at all, then? This is normal for that particular
compiler suite.


Frankly, yes I was, as Jacob, though frequently bl**dy annoying in
CLC, strikes me as a fairly careful person who probably tries to do
the job properly.

I guess there's arcanity that we all don't know. Hands up who
remembers all the digraphs? no peeking now! [/QUOTE]

Well, the text of the documentation states that HLT does NOT change
RDTSC, it goes on ticking.

OK;

But in the next sentence, the doc goes on to say that if the deep sleep
pin is asserted, RDTSC will not tick any more.

I stored wrongly in my head that the HLT instruction makes the timer
stop, instead of remembering that the deep sleep pin makes it stop.

The docs go for several thousand pages. I can't have all the details in
my mind.

Sorry for this error.

jacob
 
C

CBFalconer

jacob said:
.... snip ...

Well, the text of the documentation states that HLT does NOT change
RDTSC, it goes on ticking.

But in the next sentence, the doc goes on to say that if the deep
sleep pin is asserted, RDTSC will not tick any more.

I stored wrongly in my head that the HLT instruction makes the timer
stop, instead of remembering that the deep sleep pin makes it stop.

The docs go for several thousand pages. I can't have all the details
in my mind.

Sorry for this error.

But it is still OT for c.l.c, and the subject should never have
arisen. I see no mention of RDTSC, HLT, deep sleep, or even pins
in the C standard, which is the only documentation of interest
here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top