16 Aug
2008
16 Aug
'08
4:59 a.m.
on Fri Aug 15 2008, "Eduardo Panisset"
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#ThreadSaf...) so you're not really "exposing" anything that isn't already known ;-) -- Dave Abrahams BoostPro Computing http://www.boostpro.com