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.


work:     joachima_at_[hidden]   (
private:  joachim_at_[hidden]          (

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