Boost logo

Boost :

From: Joachim Achtzehnter (joachim_at_[hidden])
Date: 2002-06-28 11:45:06


Peter Dimov wrote:
>
> You must synchronize access to pThing (and *pThing, for that matter.)
> shared_ptr isn't more (or less) thread safe than an "ordinary" pointer.

Isn't it true that in practice, ordinary pointers are often slighly more
thread-safe than shared_ptr because on many platforms pointer assignments
are atomic, while shared_ptr assignments are not. Portable programs can't
rely on pointer assignments being atomic, of course, so I'm not suggesting
one should make use of this fact, but it might explain why people can be
surprised by this observed difference in behaviour.

Joachim

-- 
work:     joachima_at_[hidden]   (http://www.netacquire.com)
private:  joachim_at_[hidden]          (http://www.kraut.ca)

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