
7 Oct
2007
7 Oct
'07
5:14 p.m.
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.