Tagged articles

SegmentLock

1 articles · Page 1 of 1
Dabaoshi
Dabaoshi
Aug 18, 2026 · Backend Development

ConcurrentHashMap Deep Dive: Understanding Java’s Core Concurrent Container

This article explains why HashMap isn’t thread‑safe, how Hashtable’s single lock hurts performance, and walks through the evolution from JDK 1.7 segment locks to JDK 1.8’s CAS‑plus‑synchronized bucket locking, including lock‑free size counting and a comparison with CopyOnWriteArrayList for read‑heavy scenarios.

ConcurrentHashMapCopyOnWriteArrayListJDK8
0 likes · 17 min read
ConcurrentHashMap Deep Dive: Understanding Java’s Core Concurrent Container