boostorg / unordered

Boost.org unordered module
http://boost.org/libs/unordered
Boost Software License 1.0
62 stars 55 forks source link

Is erase safe for unordered concurrent structures #242

Closed diehard2 closed 4 months ago

diehard2 commented 4 months ago

Apologies for a question under issues, but I couldn't find a better place for this. Most (all?) concurrent containers are unsafe on erase. They appear to usually be marked with as 'unsafe_erase'. I can't find any documentation on the boost concurrent container's safety on the erase operation. Is it safe to erase without a lock?

joaquintides commented 4 months ago

Yes, erase is safe, this is mentioned here (bold mine):

boost::concurrent_flat_map — A hash table that associates unique keys with another value and allows for concurrent element insertion, erasure, lookup and access without external synchronization mechanisms.