Everything depends on how strong consistency you need. If you need strong one - than mutexes or other subset of operations would provide what you need.
However sometimes you need much weaker requirements but for example you need say lock-free property as you need to guarantee the throughput. On the other hand you may not need iterators at all or have much weaker restrictions on them.
So if all you need is map shared across threads ConcurrentHashMap
(say place in theatre to person booking it) would provide what you need - and it may be much faster if you have many working threads as you avoid mutex synchronization. On the other hand the speed comes at a cost - the view provided by iterator does not necessary corresponds to state of collection at it's creation and it might miss some elements created afterwords (in general in multiprocessor systems happens-before
relationship is tricky).
Edit: As Prince John Wesley pointed out I thought about ConcurrentSkipListMap
while seeing and writing. ConcurrentHashMap
. Most of the points still stand except the parts about being lock-free (as well as everything that comes from it like guaranteed throughput etc.).