Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-09-24 06:30:49

John Torjo wrote:
> Hi Peter,
> I think there is a bug in your Interlocked* implementation of
> shared_ptr (
> In atomic_read you have:
> inline long atomic_read(long volatile const & value)
> {
> return value;
> }
> I don't believe this is thread-safe.


On x86/IA32, I believe that it's as thread safe as you can get. Note that
all count updates go through Interlocked* calls. On IA32, plain reads can
only return a somewhat "surprising" value when interleaved with plain
writes, and even then, the element of surprise is limited. ;-)

Boost list run by bdawes at, gregod at, cpdaniel at, john at