delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/01/19:33:56

From: Eduardo TUDA Lorenzetti Pellini <dochell AT MailAndNews DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: RE: Any comments about using RDTSC to sync code ?
Date: Sun, 1 Apr 2001 19:29:06 -0400
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <3AC9B77D@MailAndNews.com>
X-InterChange-Posted-By: dochell AT MailAndNews DOT com
Sender: Eduardo TUDA Lorenzetti Pellini <dochell AT MailAndNews DOT com>
X-EXP32-SerialNo: 50000000
Mime-Version: 1.0
X-Newsreader: InterChange (Hydra) News v3.61.08
X-Complaints-To: newsabuse AT supernews DOT com
Lines: 45
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Thanks Tom !

>> So i think that the CPU clock may vary, but i don't know how much.
>
>Typically it's about 10%.  My athlon 1200mhz runs at "supposedly" 1211mhz
>according to various programs.

You're right, I have a PIII 733 and an Athlon 800 with the same behaviour. 
Their clocks is almost the nominal clock (PIII reports 737 Mhz and Athlon 
806 
Mhz). 
What i'm asking is about the fluctuation of the clock along the time. I 
think 
that the PC clock generator don't have any stabilization method to 
compensate 
fluctuations on the crystal voltage/temperature that would change the 
computer 
clock rate.
In this way, the computer sometimes runs at 800 Mhz... its clock will vary 
from, say, 799.3 Mhz to 810.5 Mhz... This kind of oscilation may create bad 
effects on my simulation...

>Using RDTSC to sync programs is a bad idea since RDTSC may take a variable
>amount of cycles to complete.

On my tests i discovered that the RDTSC instruction takes from 12 to 20 
clocks 
to complete. On an Athlon 800 Mhz this delay is a few nanoseconds... which i 
may forgive in my application...


Thank you for all.

Eduardo TUDA DocHell Lorenzetti Pellin
PEA - Electrical Energy and Automation Department
USP - Politechnical School of Sao Paulo University - BRAZIL
http://www.pea.usp.br/~epellini
---------------------------------
And if you have a time to loose,
an open mind, and right to choose,
would you care to take a look,
or can you read me like a book...
time's is allways on my side...
--------------------------------- (Up the Irons !!!)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019