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

Jon Schlueter jon.schlueter at gmail.com
Sun Mar 27 02:39:45 UTC 2011


On Sat, Mar 26, 2011 at 3:36 PM, Eric Raymond <esr at thyrsus.com> wrote:
> This is pushing me back towards sticking with the working seqlock.
> But *that* means I have to either deal with the pile of nonportable
> hair that is memory barriers or expensively checksum the data.

A semaphore or other OS level locking mechanism is effectively a memory
barrier... a bit heaver could be used.

Writer has it's own semaphore that it uses in place of the memory barriers
the reader has it's own semaphore that it uses in place of it's memory barriers

.... The Kernel Memory Barrier document notes that all synchronization
mechanisms impliclty have to use some sort of memory barrier to assure
correct behavior.

Jon


More information about the hackers mailing list