MemSnap: A Fast Adaptive Snapshot Algorithm for RMWable Shared-Memory

Published: 01 Jan 2024, Last Modified: 27 Sept 2024PODC 2024EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: Shared-memory words in modern multiprocessors support read-modify-write (RMW) primitives, such as compare-and-swap, fetch-and-add, and fetch-and-store, in addition to standard reads and writes. Thus, checkpointing the shared-memory of a modern multicore requires a variant of the snapshot object, which needs to support only a single scanner, but which allows components to be updated via all the RMW operations supported by hardware.In this paper, we design such an RMWable, single-scanner snapshot object, called MemSnap. MemSnap is time and space optimal: it requires only constant time per update, uses only memory linear in the number of components, and takes only linear time to scan all the components. Furthermore, MemSnap is adaptive [8, 29], meaning that it supports a click operation which quickly takes an implicit snapshot and returns nothing, and allows the scanner to efficiently read the values of the components in the snapshot through an observe method. Even from the point of view of adaptivity, the algorithm is space and time optimal, i.e., click takes only O(1) time and each observation takes only O(1) time. Consequently, MemSnap supports partial snapshots in time proportional to the number of components scanned. Additionally, MemSnap supports parallel observation---meaning that observations of the various components of the scan can be made in parallel; it also supports dynamic addition of components: meaning that new components can be added during the execution of an algorithm.The MemSnap algorithm is efficient, brief, and elegant; however, its behavior is tantalizingly complex, since it exhibits future and far-future linearization. We prove its correctness via the recently introduced meta-configuration tracking technique [21].
Loading

OpenReview is a long-term project to advance science through improved peer review with legal nonprofit status. We gratefully acknowledge the support of the OpenReview Sponsors. © 2025 OpenReview