I need to share a container (likely a hash_map) between threads. The container will be searched fairly regularly, but entries will be inserted and removed only rarely.
I assume there is a lock associated with inserting/erasing (at least around the particular item). Are there any locks associated with searching or iterating through a hash_map, assuming a const_iterator is used?
Unless I overlooked something, you have to choose between searching, inserting and iterating (concurrent_unordered_map) or searching, inserting and removing (concurrent_hash_map). The former has no visible locks, the latter has locks in the form of accessors.