Does tbb :: concurrent_unordered_map :: unsafe_erase invalidate existing iterators?

I see that tbb::concurrent_unordered_mapclose enough to std::unordered_mapbeing safe for concurrency. I also know that unsafe_eraseit is not simultaneously compatible with insertetc. The iterator docs also indicate that all existing iterators remain valid with insert, findetc.

The question is what makes unsafe_erasevoid any other iterator than the one that asked to delete?

std::unordered_mapand std::map, of course, have this behavior, but are not indicated in the documents concurrent_unordered_mapanywhere.

+4
source share
1 answer

tbb :: unsafe_erase does not cancel other iterators. This is a property that we must document.

The reason it does not invalidate other iterators is because the underlying implementation is a split-ordered list , and the iterator simply indicates that the list is.

+4
source

All Articles