VERLIB: Concurrent Versioned Pointers
Open Access
- 20 February 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 200-214
Abstract
Recent work has shown how to augment any CAS-based concurrent data structure to support taking a snapshot of the current memory state. Taking the snapshot, as well as loads and CAS (Compare and Swap) operations, take constant time. Importantly, such snapshotting can be used to easily implement linearizable queries, such as range queries, over any part of a data structure. In this paper, we make two significant improvements over this approach. The first improvement removes a subtle and hard to reason about restriction that was needed to avoid a level of indirection on pointers. We introduce an approach, which we refer to as indirection-on-need, that removes the restriction, but yet almost always avoids indirection. The second improvement is to efficiently support snapshotting with lock-free locks. This requires supporting an idempotent CAS. We show a particularly simple solution to the problem that leverages the data structures used for snapshotting. Based on these ideas we implemented an easy-to-use C++ library, verlib, centered around a versioned pointer type. The library works with lock (standard or lock-free) and CAS based algorithms, or any combination. Converting existing concurrent data-structures to use the library takes minimal effort. We present results for experiments that use verlib to convert state-of-the-art data structures for ordered maps (a B-tree), radix-ordered maps (an ART-tree), and unordered maps (an optimized hash table) to be snapshottable. The snapshottable versions perform almost as well as the original versions and far outperform any previous implementations that support atomic range queries.Keywords
Funding Information
- National Science Foundation (CCF-2119352 and CCF-1919223)
This publication has 43 references indexed in Scilit:
- Easy Lock-Free Indexing in Non-Volatile Memory2018
- A Consistency Framework for Iteration Operations in Concurrent Data Structures2015
- A Wait-Free Multi-Word Compare-and-Swap OperationInternational Journal of Parallel Programming, 2014
- Lock-Free Data-Structure Iterators2013
- Generic Multiversion STMLecture Notes in Computer Science, 2013
- Range Queries in Non-blocking k-ary Search Trees2012
- SMV: Selective Multi-Versioning STMLecture Notes in Computer Science, 2011
- Versioned boxes as the basis for memory transactionsScience of Computer Programming, 2006
- A Lazy Snapshot Algorithm with Eager Validation2006
- A Pragmatic Implementation of Non-blocking Linked-lists2001