|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-05-24 11:43:52
Kobi Cohen-Arazi wrote:
> Hi
>
> As far as we know, boost::shared_ptr has a locking overhead when
> inc/dec is invoked.
>
> I wonder:
> 1. Is it using atomic op?
It depends on the platform.
> 3. What can we do in order to be able to use shared_ptr without that
> overhead?
You can #define BOOST_SP_DISABLE_THREADS.
http://www.boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety
> 2. Why Alexandrescu policy based shared_ptr was rejected?
A policy-based smart pointer never got to the "formal review" stage. David
Held was very close to submitting one and has made a formal review request:
http://lists.boost.org/Archives/boost/2005/08/91848.php
but I don't remember what happened. Maybe he pulled it. However the Loki
version is, I believe, actively maintained.
http://loki-lib.sourceforge.net/
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net