Are unordered Boost containers readable?

For example, for MSVC , read-only is thread-safe for containers .

Does the thread support read-only thread safety?

Update: i.e. we can expect the `const 'methods to guarantee memory corruption for multi-threaded use.

+4
source share
2 answers

The upcoming standard defines the thread safety of all standard containers, and I would be very surprised if the implementation did not meet this guarantee. In particular, you should be able to read from any container instance from any stream if the thread does not modify the container.

+1
source

Typically, read operations are thread safe. I would expect that any class that implements a read-only operation (or, in a more general sense, the const function) will explicitly call the fact that it is not thread safe.

However, I see no guarantee of thread safety.

+1
source

Source: https://habr.com/ru/post/1343741/


All Articles