Thread-safe STL-compatible Wrapper Container

N

Nordlöw

Does the Boost C++ Libraries (www.boost.org) or any other library
offer a generalized STL-compatible container wrapper for making any
other STL-container thread-safe, typically by surrounding all member
functions with scoped_lock() and scoped_unlock().

/Nordlöw
 
J

James Kanze

Does the Boost C++ Libraries (www.boost.org) or any other
library offer a generalized STL-compatible container wrapper
for making any other STL-container thread-safe, typically by
surrounding all member functions with scoped_lock() and
scoped_unlock().

Why would anyone bother? It would be totally useless.
 
M

Marcel Müller

Nordlöw said:
Does the Boost C++ Libraries (www.boost.org) or any other library
offer a generalized STL-compatible container wrapper for making any
other STL-container thread-safe, typically by surrounding all member
functions with scoped_lock() and scoped_unlock().

The concept of locking function calls will never make an iteration
thread-safe in a way that the result is well defined. Iterating over a
changing collection is intrinsically thread-unsafe.


Marcel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top