Concurrency with const std :: T

As an example, consider std :: map implemented with the Splay tree. This tree structure is volatile and changes every time a map is accessed for reading. When the map is const, who should guarantee isolation of simultaneous readings, does it depend on the user code or implementation of the map?

+5
source share
3 answers

The questionnaire knows that if you have threads that write to the collection, the user must manage the synchronized lock.

The question is whether the standard can guarantee thread safety if simultaneous threads read only a collection.

, ++ - , ( , 23.2.2). , , , concurrency , , , .

STL.

:

std:: map

++ std:: set ?

+4
0

std::* .

-1

All Articles