[ntp:hackers] [Gpsd-dev] Single-writer/many-reader consistency

Dave Hart davehart at gmail.com
Sat Mar 26 16:33:36 UTC 2011


On Sat, Mar 26, 2011 at 14:58 UTC, Terje Mathisen <terje at tmsw.no> wrote:
> I suggest we extend the buffer size to 4 entries, making the entire block
> 120 bytes, since this will fit inside the same two 64-byte cache lines as
> the current layout needs.

For refclock_shm's shared memory, I am increasingly fond of Terje's
array of four timestamps and lock-free sequence number/index.  In that
context it seems to me even without memory barriers being emitted on
an architecture where they are in theory needed, ring buffering will
make it practically impossible to get an inconsistent set of
timestamps.

> The final 8 bytes (to make the total 128) is where I want to locate an
> endian-detecting marker: "GPSD-NTP":

Are you thinking of an architecture that allows for per-procecess
endian selection, or what purpose do you have in mind?  Call it a
magic number and I like the idea of sanity checking we're looking at
what we think we're looking at...

Cheers,
Dave Hart


More information about the hackers mailing list