Adaptive Lock-Free Data Structures in Haskell: A General Method for Concurrent Implementation Swapping
Chao-Hong Chen, Vikraman Choudhury, Ryan R. Newton

TL;DR
This paper introduces a general method for making lock-free data structures in Haskell adaptable by enabling runtime implementation switching through a formalized freezing technique, ensuring correctness and lock-freedom.
Contribution
It formalizes a property of lock-free algorithms allowing safe snapshotting and extends existing data structures with a freeze-and-transition capability without redesigning algorithms.
Findings
The proposed method guarantees lock-freedom and linearizability after adaptation.
Empirical case study demonstrates effective dynamic switching in concurrent maps.
The approach generalizes to various lock-free data structures in functional languages.
Abstract
A key part of implementing high-level languages is providing built-in and default data structures. Yet selecting good defaults is hard. A mutable data structure's workload is not known in advance, and it may shift over its lifetime - e.g., between read-heavy and write-heavy, or from heavy contention by multiple threads to single-threaded or low-frequency use. One idea is to switch implementations adaptively, but it is nontrivial to switch the implementation of a concurrent data structure at runtime. Performing the transition requires a concurrent snapshot of data structure contents, which normally demands special engineering in the data structure's design. However, in this paper we identify and formalize an relevant property of lock-free algorithms. Namely, lock-freedom is sufficient to guarantee that freezing memory locations in an arbitrary order will result in a valid snapshot.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
