You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've encountered several places where concurrent access to maps is possible, but no locking is provided. Neither std::map or std::unordered_map are thread safe, so locks will need to be added.
One option for handling this is by adding a "safe" map wrapper that leverages a std::shared_mutex to allow parallel read-only access to the map (safe) while restricting modification to exclusive access modes. I've put a proposed PR into up-cpp with SafeMap and SafeUnorderedMap.
The text was updated successfully, but these errors were encountered:
We've encountered several places where concurrent access to maps is possible, but no locking is provided. Neither
std::map
orstd::unordered_map
are thread safe, so locks will need to be added.One option for handling this is by adding a "safe" map wrapper that leverages a
std::shared_mutex
to allow parallel read-only access to the map (safe) while restricting modification to exclusive access modes. I've put a proposed PR into up-cpp withSafeMap
andSafeUnorderedMap
.The text was updated successfully, but these errors were encountered: