[time-nuts] FreeBSD, NetBSD, or Minix-III?
Lux, James P
james.p.lux at jpl.nasa.gov
Sun May 17 16:30:00 UTC 2009
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.
More information about the Time-nuts_lists.febo.com
mailing list