- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Something confuse me when i use tbb::concurrent_unordered_map, but can I erase the item while updating the other one or inserting a new one? What is unsafe_erase exactly mean?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Reference Manual is pretty clear on that: "The erase methods are prefixed with unsafe_, to indicate that they are not concurrency safe."
Only use such methods while no other threads are accessing the container (the exclusion is per instance even if the documentation does not explicitly say so), or consider using concurrent_hash_map instead.
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