Java / Concurrent collections
How does ConcurrentHashMap achieve thread-safety?
ConcurrentHashMap achieves thread-safety by dividing the map into segments and locking only the segment which requires instead of locking the whole map. It achieves thread-safety using locking but it performs better because it never locks the whole map.
This technique is also known as lock stripping.
More Related questions...