skip to main content
10.1145/3627535.3638501acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections
research-article
Open access

VERLIB: Concurrent Versioned Pointers

Published: 20 February 2024 Publication History

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.

References

[1]
Archita Agarwal, Zhiyu Liu, Eli Rosenthal, and Vikram Saraph. 2017. Linearizable Iterators for Concurrent Data Structures. CoRR abs/1705.08885 (2017). http://arxiv.org/abs/1705.08885
[2]
Maya Arbel-Raviv and Trevor Brown. 2018. Harnessing Epoch-Based Reclamation for Efficient Range Queries. In Proc. 23rd ACM Symposium on Principles and Practice of Parallel Programming. 14--27.
[3]
Hagit Attiya, Ohad Ben-Baruch, and Danny Hendler. 2018. Nesting-Safe Recoverable Linearizability: Modular Constructions for NonVolatile Memory. In ACM Symposium on Principles of Distributed Computing (PODC).
[4]
Hillel Avni, Nir Shavit, and Adi Suissa. 2013. Leaplist: Lessons Learned in Designing TM-Supported Range Queries. In Proc. 2013 ACM Symposium on Principles of Distributed Computing. 299--308.
[5]
Greg Barnes. 1993. A method for implementing lock-free shared-data structures. In ACM Symposium on Parallelism in Algorithms and Architectures (SPAA). 261--270.
[6]
Dmitry Basin, Edward Bortnikov, Anastasia Braginsky, Guy Golan-Gueta, Eshcar Hillel, Idit Keidar, and Moshe Sulamy. 2020. KiWi: A Key-Value Map for Scalable Real-Time Analytics. ACM Trans. Parallel Comput. 7, 3, Article 16 (June 2020), 28 pages.
[7]
Naama Ben-David, Guy Blelloch, and Yuanhao Wei. 2022. The flock library. https://github.com/cmuparlay/flock.
[8]
Naama Ben-David, Guy Blelloch, and Yuanhao Wei. 2022. Lock-Free Locks Revisited. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP).
[9]
Naama Ben-David, Guy E. Blelloch, Panagiota Fatourou, Eric Ruppert, Yihan Sun, and Yuanhao Wei. 2021. Space and Time Bounded Multiversion Garbage Collection. In International Symposium on Distributed Computing (DISC). 12:1--12:20.
[10]
Naama Ben-David, Guy E Blelloch, Michal Friedman, and Yuanhao Wei. 2019. Delay-free concurrency on faulty persistent memory. In ACM Symposium on Parallelism in Algorithms and Architectures (SPAA). 253--264.
[11]
Philip A. Bernstein and Nathan Goodman. 1983. Multiversion Concurrency Control - Theory and Algorithms. 8, 4 (Dec. 1983), 465--483.
[12]
Guy E Blelloch, Daniel Anderson, and Laxman Dhulipala. 2020. ParlayLib-A toolkit for parallel algorithms on shared-memory multicore machines. In ACM Symposium on Parallelism in Algorithms and Architectures (SPAA). 507--509.
[13]
Jan Böttcher, Viktor Leis, Thomas Neumann, and Alfons Kemper. 2019. Scalable garbage collection for in-memory MVCC systems. Proceedings of the VLDB Endowment 13, 2 (2019), 128--141.
[14]
Nathan G. Bronson, Jared Casper, Hassan Chafi, and Kunle Olukotun. 2010. A Practical Concurrent Binary Search Tree. In Proc. 15th ACM Symposium on Principles and Practice of Parallel Programming. 257--268.
[15]
Jeremy Brown, J. P. Grossman, and Tom Knight. 2002. A Lightweight Idempotent Messaging Protocol for Faulty Networks. In ACM Symposium on Parallelism in Algorithms and Architectures (SPAA). 248--257.
[16]
Trevor Brown and Hillel Avni. 2012. Range Queries in Non-blocking k-ary Search Trees. In Proc. 16th International Conference on Principles of Distributed Systems (LNCS, Vol. 7702). 31--45.
[17]
João Cachopo and Antönio Rito-Silva. 2006. Versioned Boxes as the Basis for Memory Transactions. Science of Computer Programming 63, 2 (2006), 172--185.
[18]
Bapi Chatterjee. 2017. Lock-free Linearizable 1-Dimensional Range Queries. In Proc. 18th Intl Conf. on Dist. Computing and Networking. 9:1--9:10.
[19]
Brian F. Cooper, Adam Silberstein, Erwin Tam, Raghu Ramakrishnan, and Russell Sears. 2010. Benchmarking Cloud Serving Systems with YCSB. In Proc. 1st ACM Symposium on Cloud Computing. 143--154.
[20]
Tudor David, Rachid Guerraoui, and Vasileios Trigonakis. 2015. Asynchronized concurrency: The secret to scaling concurrent search data structures. ACM SIGARCH Computer Architecture News 43, 1 (2015), 631--644.
[21]
Marc A. de Kruijf, Karthikeyan Sankaralingam, and Somesh Jha. 2012. Static Analysis and Compiler Design for Idempotent Processing. In ACM Conference on Programming Language Design and Implementation (PLDI).
[22]
Cristian Diaconu, Craig Freedman, Erik Ismert, Per-Ake Larson, Pravin Mittal, Ryan Stonecipher, Nitin Verma, and Mike Zwilling. 2013. Hekaton: SQL Server's Memory-optimized OLTP Engine. In ACM SIGMOD International Conference on Management of Data (SIGMOD). 1243--1254.
[23]
Dave Dice and Alex Garthwaite. 2002. Mostly lock-free malloc. In International Symposium on Memory Management (ISMM). 163--174.
[24]
Dave Dice, Ori Shalev, and Nir Shavit. 2006. Transactional Locking II. In International Symposium on Distributed Computing (DISC).
[25]
Nuno Diegues and Paolo Romano. 2015. Time-Warp: Efficient Abort Reduction in Transactional Memory. ACM Trans. Parallel Comput. 2, 2, Article 12 (June 2015), 44 pages.
[26]
Faith Ellen, Panagiota Fatourou, Eric Ruppert, and Franck van Breugel. 2010. Non-blocking binary search trees. In ACM Symposium on Principles of Distributed Computing (PODC).
[27]
Panagiota Fatourou, Yiannis Nikolakopoulos, and Marina Papatriantafilou. 2017. Linearizable Wait-Free Iteration Operations in Shared Double-Ended Queues. Parallel Processing Letters 27, 2 (2017), 1--17.
[28]
Panagiota Fatourou, Elias Papavasileiou, and Eric Ruppert. 2019. Persistent Non-Blocking Binary Search Trees Supporting Wait-Free Range Queries. In Proc. 31st ACM Symposium on Parallelism in Algorithms and Architectures. 275--286.
[29]
Steven Feldman, Pierre LaBorde, and Damian Dechev. 2015. A wait-free multi-word compare-and-swap operation. International Journal of Parallel Programming 43, 4 (2015), 572--596.
[30]
Sérgio Miguel Fernandes and João Cachopo. 2011. Lock-Free and Scalable Multi-Version Software Transactional Memory. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP). 179--188.
[31]
Rachid Guerraoui, Alex Kogan, Virendra J Marathe, and Igor Zablotchi. 2020. Efficient multi-word compare and swap. International Symposium on Distributed Computing (DISC).
[32]
Tim Harris, Mark Plesko, Avraham Shinnar, and David Tarditi. 2006. Optimizing memory transactions. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation. 14--25.
[33]
Timothy L Harris. 2001. A pragmatic implementation of non-blocking linked-lists. In International Symposium on Distributed Computing (DISC). Springer, 300--314.
[34]
Timothy L Harris, Keir Fraser, and Ian A Pratt. 2002. A practical multiword compare-and-swap operation. In International Symposium on Distributed Computing (DISC). 265--279.
[35]
Maurice Herlihy, Victor Luchangco, Mark Moir, and William N. Scherer. 2003. Software Transactional Memory for Dynamic-Sized Data Structures. In ACM Symposium on Principles of Distributed Computing (PODC).
[36]
Sanidhya Kashyap, Changwoo Min, Kangnyeon Kim, and Taesoo Kim. 2018. A Scalable Ordering Primitive for Multicore Machines. In ACM European Conference on Computer Systems (EuroSys). Article 34, 15 pages.
[37]
Tadeusz Kobus, Maciej Kokociński, and Paweł T. Wojciechowski. 2022. Jiffy: A Lock-Free Skip List with Batch Updates and Snapshots. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP).
[38]
Priyanka Kumar, Sathya Peri, and K. Vidyasankar. 2014. A TimeStamp Based Multi-version STM Algorithm. In Intl Conf. on Dist. Computing and Networking. 212--226.
[39]
Viktor Leis, Alfons Kemper, and Thomas Neumann. 2013. The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases. In IEEE International Conference on Data Engineering (ICDE).
[40]
Viktor Leis, Florian Scheibner, Alfons Kemper, and Thomas Neumann. 2016. The ART of Practical Synchronization. In Proc. International Workshop on Data Management on New Hardware.
[41]
Hyeontaek Lim, Michael Kaminsky, and David G. Andersen. 2017. Cicada: Dependably Fast Multi-Core In-Memory Transactions. In ACM SIGMOD International Conference on Management of Data (SIGMOD). 21--35.
[42]
Li Lu and Michael L Scott. 2013. Generic multiversion STM. In Proc. International Symposium on Distributed Computing. Springer, 134--148.
[43]
Virendra Marathe, Michael Spear, Christopher Heriot, Athul Acharya, David Eisenstat, William Scherer, and Michael Scott. 2006. Lowering the overhead of nonblocking software transactional memory. In ACM SIGPLAN Workshop on Transactional Computing (TRANSACT).
[44]
Aravind Natarajan and Neeraj Mittal. 2014. Fast Concurrent Lock-Free Binary Search Trees. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP).
[45]
Jacob Nelson-Slivon, Ahmed Hassan, and Roberto Palmieri. 2022. Bundling Linked Data Structures for Linearizable Range Queries. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP). 368--384.
[46]
Thomas Neumann, Tobias Mühlbauer, and Alfons Kemper. 2015. Fast Serializable Multi-version Concurrency Control for Main-Memory Database Systems. In ACM SIGMOD International Conference on Management of Data (SIGMOD). 677--689.
[47]
Yiannis Nikolakopoulos, Anders Gidenstam, Marina Papatriantafilou, and Philippas Tsigas. 2015. A Consistency Framework for Iteration Operations in Concurrent Data Structures. In Proc. IEEE International Parallel and Distributed Processing Symposium. 239--248.
[48]
Christos H Papadimitriou and Paris C Kanellakis. 1984. On Concurrency Control by Multiple Versions. ACM Transactions on Database Systems 9, 1 (1984), 89--99.
[49]
Dmitri Perelman, Anton Byshevsky, Oleg Litmanovich, and Idit Keidar. 2011. SMV: Selective Multi-Versioning STM. In Proc. International Symposium on Distributed Computing. 125--140.
[50]
Dmitri Perelman, Rui Fan, and Idit Keidar. 2010. On Maintaining Multiple Versions in STM. In ACM Symp. on Principles of Dist. Computing. 16--25.
[51]
Erez Petrank and Shahar Timnat. 2013. Lock-Free Data-Structure Iterators. In Proc. 27th Intl Symposium on Distributed Computing. 224--238.
[52]
Dan R. K. Ports and Kevin Grittner. 2012. Serializable Snapshot Isolation in PostgreSQL. Proc. of the VLDB Endowment 5, 12 (Aug. 2012), 1850--1861.
[53]
D. Reed. 1978. Naming and synchronization in a decentralized computer system. Technical Report LCS/TR-205. EECS Dept., MIT.
[54]
Torvald Riegel, Pascal Felber, and Christof Fetzer. 2006. A Lazy Snapshot Algorithm with Eager Validation. In International Symposium on Distributed Computing. Springer, 284--298.
[55]
Wenjia Ruan, Yujie Liu, and Michael Spear. 2013. Boosting Timestamp-Based Transactional Memory by Exploiting Hardware Cycle Counters. ACM Trans. Archit. Code Optim. 10, 4 (dec 2013), 21 pages.
[56]
Niloufar Shafiei. 2014. Non-Blocking Doubly-Linked Lists with Good Amortized Complexity. arXiv:1408.1935 [cs.DC]
[57]
Gali Sheffi, Pedro Ramalhete, and Erez Petrank. 2023. EEMARQ: Efficient Lock-Free Range Queries with Memory Reclamation. In 26th International Conference on Principles of Distributed Systems (OPODIS 2022). Schloss Dagstuhl-Leibniz-Zentrum für Informatik.
[58]
Anubhav Srivastava and Trevor Brown. 2022. Elimination (a,b)-Trees with Fast, Durable Updates. In Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (Seoul, Republic of Korea) (PPoPP '22). Association for Computing Machinery, New York, NY, USA, 416--430.
[59]
Stephen Tu, Wenting Zheng, Eddie Kohler, Barbara Liskov, and Samuel Madden. 2013. Speedy Transactions in Multicore In-Memory Databases. In ACM Symposium on Operating Systems Principles (SOSP). 18--32.
[60]
John Turek, Dennis Shasha, and Sundeep Prakash. 1992. Locking without blocking: making lock based concurrent data structure algorithms nonblocking. In Principles of Database Systems (PODS). 212--222.
[61]
Tianzheng Wang, Justin Levandoski, and Per-Ake Larson. 2018. Easy lock-free indexing in non-volatile memory. In IEEE International Conference on Data Engineering (ICDE). IEEE, 461--472.
[62]
Yuanhao Wei, Naama Ben-David, Guy E. Blelloch, Panagiota Fatourou, Eric Ruppert, and Yihan Sun. 2021. Constant-time snapshots with applications to concurrent data structures. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP). 31--46.
[63]
Yuanhao Wei, Guy E. Blelloch, Panagiota Fatourou, and Eric Ruppert. 2023. Practically and Theoretically Efficient Garbage Collection for Multiversioning. In ACM Symposium on Principles and Practice of Parallel Programming (PPOPP).
[64]
Kjell Winblad, Konstantinos Sagonas, and Bengt Jonsson. 2018. Lock-Free Contention Adapting Search Trees. In Proc. 30th Symposium on Parallelism in Algorithms and Architectures. 121--132.
[65]
Kjell Winblad, Konstantinos Sagonas, and Bengt Jonsson. 2021. Lockfree contention adapting search trees. ACM Transactions on Parallel Computing (TOPC) 8, 2 (2021), 1--38.
[66]
Yingjun Wu, Joy Arulraj, Jiexi Lin, Ran Xian, and Andrew Pavlo. 2017. An Empirical Evaluation of In-memory Multi-version Concurrency Control. Proceedings of the VLDB Endowment (PVLDB) 10, 7 (March 2017), 781--792.
[67]
Xiangyao Yu, Andrew Pavlo, Daniel Sanchez, and Srinivas Devadas. 2016. TicToc: Time Traveling Optimistic Concurrency Control. In ACM SIGMOD International Conference on Management of Data (SIGMOD). 1629--1642.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PPoPP '24: Proceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming
March 2024
498 pages
ISBN:9798400704352
DOI:10.1145/3627535
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 February 2024

Check for updates

Badges

Author Tags

  1. multiversioning
  2. concurrent data structures
  3. snapshots
  4. lock-based
  5. lock-free

Qualifiers

  • Research-article

Funding Sources

Conference

PPoPP '24

Acceptance Rates

Overall Acceptance Rate 230 of 1,014 submissions, 23%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 605
    Total Downloads
  • Downloads (Last 12 months)605
  • Downloads (Last 6 weeks)74
Reflects downloads up to 22 Dec 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media