- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page