MCP
arXivarXiv
Preprint
Published: January 13, 2025
cs.DC
v2

Big Atomics

Abstract
Atomic operations, such as load, store, and compare-and-swap (CAS), on single words form the basis of multiprocessor programming. Atomics on multiple adjacent words, i.e., Big Atomics, are a powerful construct with wide utility in concurrent programming and algorithm design. Unfortunately, there are no existing algorithms for big atomics that are simultaneously efficient in theory and practice. Algorithms based on sequence locks work well in practice when processes are not interrupted, but are blocking, and hence not theoretically efficient, nor efficient in practice under contention and oversubscription. On the other hand, theoretically efficient non-blocking solutions (wait-free or lock-free) require a level of indirection and suffer a significant practical cost. In this paper, we present two new algorithms for big atomics, which are non-blocking, but avoid indirection in most cases. The first algorithm is wait-free and supports operations in time proportional to the size of the atomic, but requires storing two copies of each object. The second is lock-free and its memory usage is optimal within low-order terms. Both use a practical caching scheme, in which updated values are temporarily stored using a level of indirection and then are replaced with the direct value. We experimentally evaluate our algorithms, comparing them to traditional locks, sequence locks, hardware transactional memory (HTM), and indirection (wait-free). Comparisons are across a broad set of workloads. Our experiments show that our algorithms, and our lock-free memory-efficient algorithm in particular, perform competitively with the best blocking solution (sequence lock) in friendly conditions, but are significantly better when there are more software threads than hardware threads (oversubscription). We also measure the performance of big atomics as part of ParlayHash, a state-of-the-art concurrent hash map.
0
AI overview
Reviews
Citation graph
Structured
This paper does not have an AI preview yet
Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first