Skip to content

Concurrent Hash Table

A hash-addressed key–value table with an operation protocol that preserves specified mapping semantics when supported calls overlap.

Version
v1 · 2026-10-17 · History
Domain-specific #
14099
Domain group
Applied Sciences & Engineering
Origin domain
Computer Science & Software Engineering
Subdomain
Concurrent Data Structures → Computer Science & Software Engineering
Aliases
Concurrent hash map

Core Idea

A concurrent hash table stores key–value mappings at locations found by hashing keys and defines what supported operations may report when callers invoke them at overlapping times. Hashing answers where to look. A coordination or validation protocol answers what a lookup may safely observe while an update proceeds. A table keeps this identity even in a run where only one caller uses it.[1][2]

The exact contract matters. Java SE 17 ConcurrentHashMap allows ordinary retrievals to overlap updates and describes per-key visibility after a completed update; its aggregate operations need not give a frozen view of the entire map.[1] MemC3's cuckoo-hash cache index lets several readers operate alongside one serialized writer, with relocation and version checks that prevent a false miss during an insertion.[2] Both are concurrent hash tables, but they make different promises and use different mechanisms.

How would you explain it like I'm…

Share-at-Once Cubbies

Imagine a big toy cubby wall where each toy's name tells you which cubby it goes in. Lots of kids can use the wall at the same time. There are rules so that when someone is moving a toy, nobody grabs a half-moved toy or thinks it's missing.

Share-at-Once Lookup Table

A hash table stores pairs like a name and a phone number, and a quick math trick (the hash) tells you which slot to check for a name. A concurrent hash table lets many parts of a program use it at overlapping times. It has a promise, called a contract, about what you'll see: for example, someone looking up a name won't get a broken, half-finished entry while someone else is updating it. The promise only covers certain actions, so not everything is guaranteed. And it is still a concurrent table even if a program only uses it one at a time.

Hash Map with Concurrency Contract

A concurrent hash table is a key-value table, addressed by hashing, that comes with a stated contract for what happens when operations are called at overlapping times. The hash tells you where a key's entry can be found, and a coordination or validation protocol makes sure a lookup never accepts an invalid in-between state during an update. The contract spells out which operations and observations are covered. For example, Java's ConcurrentHashMap lets reads like get overlap writes like put, but a bulk operation like counting the whole table isn't a frozen snapshot. MemC3's cuckoo index lets many readers run alongside one writer and uses version checks so a reader doesn't wrongly report a key as missing while it's being moved. Different designs, same idea: not one locking method, but a hash map with a concurrency promise.

 

A concurrent hash table is a hash-addressed key–value mapping that comes with an explicit contract for its supported operations under overlapping invocation. Hashing fixes where a key's mapping can be found; a coordination or validation protocol ensures readers don't accept an invalid intermediate mapping during an update. The contract determines exactly which operations and observations are protected, and being concurrent-capable is a property of the table, not of whether a given program actually uses multiple threads. Realizations differ. Java SE 17's ConcurrentHashMap lets retrievals generally overlap updates and documents that a retrieval reporting a value sees the completed update that produced it, while bulk and status operations are not atomic whole-table snapshots. MemC3's concurrent cuckoo index allows multiple readers with a single serialized writer, using a backward displacement path and version checks so that readers never report a false miss while an insertion relocates an existing key. What unifies these is the concurrency contract on a hashed mapping, not a shared locking algorithm or throughput profile.

What It Is Not

An ordinary unsynchronized HashMap is not made safe for overlapping structural changes merely by sharing it between threads; Oracle requires external synchronization in that case.[3] A read-only shared map also does not thereby have an overlap contract for mutation.

A concurrent hash table need not let writers change unrelated keys simultaneously. MemC3 permits only one writer at a time.[2] It also does not promise that every operation is linearizable or that an iterator or count is an atomic snapshot. Linearizability is a separate test on an operation history against a legal sequential specification.[4] Java's aggregate operations may report a changing state.[1]

Scope of Application

The term covers hash-addressed, in-memory associative structures that support specified overlapping calls, including a shared runtime map, a concurrent cache index, or a synchronized wrapper around a hash-backed map. Oracle's synchronized wrapper serializes access through the wrapper, and it still requires manual synchronization when traversing a collection view.[5] A serialized implementation can therefore qualify if its access contract handles overlapping callers. An entire cache's eviction policy does not follow from the concurrency of its index.[2]

Clarity

When choosing a table, ask four questions: What keys and values does it map? Which callers may overlap? How does it prevent an invalid lookup during an update? Which operations have which observation guarantees? “Thread-safe” without an operation scope does not answer the last question. In Java, a completed per-key update can have a documented visibility relation while size() or a bulk result remains transient under concurrent updates.[1]

Manages Complexity

The table gives callers a keyed interface while hiding the interleaving steps that maintain it. MemC3 may move entries along a cuckoo path during insertion. Its writer computes the path, moves occupants backward, and uses versions so a reader can retry if it overlaps a relocation.[2] This removes one class of lookup error from the caller's burden. It does not turn several application-level map calls into one transaction.

Abstract Reasoning

Identify the hashed mapping first, then evaluate each supported operation under overlap. A reader must not accept a mapping that the implementation's contract rules out. A writer's coordination method can be a single lock, a finer-grained protocol, or version-based validation; the method alone does not tell you whether a whole-table result is atomic. Oracle's synchronized wrapper uses one facade, while MemC3 uses one writer with optimistic reader checks.[5][2]

Knowledge Transfer

The same four questions apply to runtime maps and cache indexes, but a guarantee from one implementation does not transfer automatically to the other. A read-heavy MemC3 workload benefits from overlapping readers but its single writer becomes a bottleneck when writes grow more common.[2] A synchronized wrapper supplies a simpler serialized access pattern.[5] Choose based on the operations and observations the program actually needs.

Examples

Java runtime map. Several threads update task states by task ID in a ConcurrentHashMap. The task ID is the hashed key and the state is the value. Threads can invoke calls concurrently, and the map coordinates them. A get reporting a completed update has the documented per-key visibility relation, while size() is not a reliable whole-table completion snapshot during updates.[1]

MemC3 cache index. Object keys hash to two candidate bucket locations. Several readers can look up keys while one writer inserts an entry and displaces existing occupants. Backward relocation and version checks protect the lookup from reporting a false miss during that insertion.[2] These are the hash-addressed mapping, overlapping callers, validation protocol, and scoped lookup guarantee; they do not describe the cache's entire storage or eviction behavior.

Relationships to Other Abstractions

Local relationship map for Concurrent Hash TableParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Concurrent Hash TableDOMAINPrime abstraction: Data Structure — is a kind ofData StructurePRIME

Current abstraction Concurrent Hash Table Domain-specific

Parents (1) — outgoing typed relations

  • Concurrent Hash Table is a kind of Data Structure Prime

    A concurrent hash table is a data structure whose hash-addressed mapping adds defined semantics for supported operations that overlap.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Concurrent Hash Table sits in a sparse region of the domain-specific corpus (94th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (3155 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] Oracle, “ConcurrentHashMap (Java SE 17 & JDK 17),” official Java API documentation, class description and bulk-operations discussion, https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/ConcurrentHashMap.html (full HTML inspected; supports per-key retrieval/update visibility and explicit aggregate limitations). registry ↩a ↩b ↩c ↩d ↩e

[2] Bin Fan, David G. Andersen, and Michael Kaminsky (2013), “MemC3 Compact and Concurrent MemCache with Dumber Caching and Smarter Hashing,” USENIX NSDI, https://www.cs.cmu.edu/~binfan/papers/nsdi13_memc3.pdf (original full PDF inspected; §3 interface, §3.2 one-based PDF pp. 5–6 on one writer, backward displacement and optimistic lookup, §5.2/Fig. 6 on measured bottlenecks, and Appendix A on lookup correctness). registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g ↩h

[3] Oracle, “HashMap (Java SE 17 & JDK 17),” official Java API documentation, class description synchronization paragraph, https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/HashMap.html (full HTML inspected; external synchronization required for concurrent access with structural modification). registry ↩

[4] Maurice P. Herlihy and Jeannette M. Wing, “Linearizability A Correctness Condition for Concurrent Objects,” ACM Transactions on Programming Languages and Systems 12, no. 3 (1990): 463–492, https://www.cs.cmu.edu/~wing/publications/HerlihyWing90.pdf (original full PDF inspected; abstract and §2 define the history correctness condition). registry ↩

[5] Oracle, “Collections.synchronizedMap (Java SE 17 & JDK 17),” official Java API documentation, synchronizedMap method, https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Collections.html (full HTML inspected; serial access through the returned map and external synchronization for traversal). registry ↩a ↩b ↩c