Boost logo

Boost :

Subject: [boost] thread_safe_ptr class interest request
From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2010-07-28 09:44:52


I've made a thread_safe_ptr class available at

The idea is to use it like so:

std::string data = "Hello world;";
thread_safe_ptr<std::string> data_ptr(&data);

void thread1()

void thread2()
    *data_ptr = "yeah";

boost::thread t1(&thread1);
boost::thread t2(&thread1);
t1.join(); t2.join();

Do you see an obvious show-stopper for me not to continue developping this
What's still to be done is worry about ownership of objects, my idea is to
eventually somewhat model it after boost::shared_ptr that way it's easier to
pass those around.

When I'll be satisfied with the result, my plan is to "boostify" it
(namespaces, license etc) and maybe propose it for inclusion in the smart
pointer library.

What are your thoughts?


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