Boost logo

Boost :

Subject: [boost] [Boost.smart_ptr] Thread Safety
From: Thomas Jordan (thomasjordan_at_[hidden])
Date: 2012-01-07 05:53:20

Sorry, please ignore my previous post - finger trouble. The question is as follows:

Is shared_array completely thread-safe, including destruction/reference counting? From the code in /boost/detail/sp_counted_base_pt.hpp it looks like it probably is but according to

// thread A
p3 = p2; // reads p2, writes p3

// thread B
// p2 goes out of scope: undefined, the destructor is considered a "write access"

shared_ptr isn't completely thread-safe for simultaneous read and write/destruct access? The same would presumbly apply to shared_array?
Maybe I've missed something, are there compile-time configuration options to determine level of safety?


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