Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-10-07 13:14:45


Anthony,

Just a couple of quick questions/comments regarding the use of
_ReadWriteBarrier in the latest Boost.Thread code:

First up _ReadWriteBarrier is a VC++ compiler intrinsic: it's not supported
by the Borland or MingW compilers, so these fail to link with unresolved
externals to _ReadWriteBarrier. Can interlocked_read_acquire be written in
terms of InterlockedCompareExchange(pointer, 0, 0) and
InterlockedCompareExchangePointer(pointer-to-pointer, 0, 0) in these cases?

Secondly, I'm a bit confused why the barrier is *after* the read, shouldn't
it be before? I'm not saying it should be, I just wondered :-)

Thanks, John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk