SYSTEM Cited by 1 source
folly::ConcurrentHashMap¶
folly::ConcurrentHashMap is the concurrent hash-map primitive
in folly, Meta's open-source
C++ library of general-purpose building blocks. Source:
folly/concurrency/ConcurrentHashMap.h.
Cited in the 2024-12-02 cryptographic monitoring post as the internal data structure the FBCrypto aggregating buffered logger uses, selected because it is "built to be performant under heavy writes in multithreaded environments, while still guaranteeing atomic accesses."
Role for this wiki¶
- Write-heavy multithreaded map primitive. The canonical Meta choice when many threads need to update counters concurrently without coarse-grained locking.
- Enables client-side aggregation of very high-rate events. FBCrypto's per-event counter increment happens on every cryptographic operation in every calling thread — "machines often compute millions of cryptographic operations per day" — so the map's write performance is load-bearing for the whole aggregating-buffered-logger architecture.
Seen in¶
- sources/2024-12-02-meta-built-large-scale-cryptographic-monitoring — named as the data structure underneath FBCrypto's in-process event-count buffer. "In multithreaded environments all threads will log to the same buffer. For this to be performant, we need to choose the right underlying data structure."
Related¶
- systems/fbcrypto — the consumer.
- systems/folly-singleton — folly's singleton primitive used for the FBCrypto buffered-logger global.
- patterns/aggregating-buffered-logger — the pattern whose write-performance requirement this map primitive satisfies.