Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jczhang_bj
Beginner
38 Views

Question about tbb::concurrent_unordered_map

The document says "A concurrent_unordered_map supports concurrent insertion and traversal, but not concurrent erasure."

What is the meaning of concurrent erasure? In my application, multiple threads concurrently insert items in a map, but only ONE thread may erase items. Concurrent insertion and erasure use different keys.

Is it safe to use concurrent_unordered_map?

Thanks

--Junchao

0 Kudos
1 Reply
Anton_M_Intel
Employee
38 Views

concurrency of erasure means it is concurrent to other operations (inserts). No, it is not safe. Please look at tbb::concurrent_hash_map instead (but it has no safe traversal)
Reply