Boost logo

Boost :

From: Joachim Achtzehnter (joachim_at_[hidden])
Date: 2002-06-28 12:09:37

Terence Wilson wrote:
> Mmm. I understand that the actual object pointed to must be made thread
> safe, however, can I assume that shared_ptr is thread safe? i.e. it will
> correctly maintain use counters while being accessed from multiple
> threads?


Making shared_ptr (or pretty much any object from the boost library)
threadsafe in this sense would impose a huge performance penalty on
programs (even multi-threaded ones) that don't need synchronization at
such a microscopic level.

On the other hand, it would certainly be useful to have the option of a
thread-safe shared_ptr. Perhaps we'll get this with a future standard
policy-based smart pointer... :-)


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

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