[time-nuts] FreeBSD, NetBSD, or Minix-III?

Magnus Danielson magnus at rubidium.dyndns.org
Sun May 17 16:38:24 UTC 2009


Lux, James P skrev:
> 
> 
> On 5/17/09 9:24 AM, "Hal Murray" <hmurray at megapathdsl.net> wrote:
> 
>>
>>> In which case, if you're saddled with 32 bit (or 8 bit!) reads, you
>>> have to do multiple reads, so that by the end of the process, you can
>>> assure yourself it's consistent.
>>> E.g read high, read low, read high, read low So you can check low #1
>>> against low #2, and figure out if you had a roll over.
>> Why read the low twice?
>>
>> I though the normal recipe was to read high, low, high.  If the two highs are
>> the same you know a carry didn't happen so a high/low pair is a valid reading.
> 
> Yes, but then, if it did happen, then you need to read low again. If you do
> the 4 reads as a block (say, with interrupts disabled), then you get a nice
> deterministic timing for the code.  In practice, it's just a design decision
> which way one does it.

No, if the high parts differs, then the MSB of the lower part indicates 
which of the higher parts to go with it, MSB low is the late high read 
and MSB high is the early high read. Infact, by always look at the MSB 
then it will always be correct. With a second lower read will the low 
read point in time be modulated and hence jitter is added.

Cheers,
Magnus



More information about the time-nuts mailing list