libcds2 icon indicating copy to clipboard operation
libcds2 copied to clipboard

Use() and Unuse() functions are not thread-safe

Open fclaude opened this issue 13 years ago • 2 comments

fclaude avatar Feb 29 '12 19:02 fclaude

It is not clear how to fix this, the ideal would be to not use extra space, but that would mean sharing a mutex among all classes (that kind of sucks) ... any suggestions?

fclaude avatar Feb 29 '12 19:02 fclaude

Is it possible to reuse an existing reference-counting scheme instead of creating one? C++11 has std::shared_ptr, and Boost has boost::shared_ptr, which doesn't depend on C++11.

Boost has addressed the issue of thread-safety(http://www.boost.org/doc/libs/1_51_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety).

nburns1980 avatar Oct 10 '12 22:10 nburns1980