Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2008-08-16 00:59:21


on Fri Aug 15 2008, "Eduardo Panisset" <eduardo.panisset-AT-gmail.com> wrote:

> Yes,
>
> But then, the question is: Can I have simultaneous read/write
> operations on shared_ptr ?

Not without additional synchronization (e.g. via a mutex with all
threads cooperating by locking before accessing the shared_ptr). But do
you really need to do that? Can you not give each thread that needs
access a separate copy of the shared_ptr?

> I don´t think so, because the reasons already exposed. Right ?

Correct. And the documentation says as much
(http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety)
so you're not really "exposing" anything that isn't already known ;-)

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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