[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Concurrent size

Published: 31 October 2022 Publication History

Abstract

The size of a data structure (i.e., the number of elements in it) is a widely used property of a data set. However, for concurrent programs, obtaining a correct size efficiently is non-trivial. In fact, the literature does not offer a mechanism to obtain a correct (linearizable) size of a concurrent data set without resorting to inefficient solutions, such as taking a full snapshot of the data structure to count the elements, or acquiring one global lock in all update and size operations. This paper presents a methodology for adding a concurrent linearizable size operation to sets and dictionaries with a relatively low performance overhead. Theoretically, the proposed size operation is wait-free with asymptotic complexity linear in the number of threads (independently of data-structure size). Practically, we evaluated the performance overhead by adding size to various concurrent data structures in Java−a skip list, a hash table and a tree. The proposed linearizable size operation executes faster by orders of magnitude compared to the existing option of taking a snapshot, while incurring a throughput loss of 1%−20% on the original data structure’s operations.

References

[1]
2022. Java Platform Version 18 API Specification. https://docs.oracle.com/en/java/javase/18/docs/api/index.html
[2]
Yehuda Afek, Hagit Attiya, Danny Dolev, Eli Gafni, Michael Merritt, and Nir Shavit. 1993. Atomic snapshots of shared memory. JACM, 40, 4 (1993), https://doi.org/10.1145/153724.153741
[3]
Yehuda Afek, Nir Shavit, and Moran Tzafrir. 2012. Interrupting snapshots and the Java™ size method. J. Parallel and Distrib. Comput., 72, 7 (2012), https://doi.org/10.1016/j.jpdc.2012.03.007
[4]
Maya Arbel-Raviv and Trevor Brown. 2018. Harnessing epoch-based reclamation for efficient range queries. In PPoPP. https://doi.org/10.1145/3178487.3178489
[5]
James Aspnes, Maurice Herlihy, and Nir Shavit. 1994. Counting networks. JACM, 41, 5 (1994), https://doi.org/10.1145/185675.185815
[6]
Trevor Brown. 2018. Java Lock-Free Data Structure Library. https://bitbucket.org/trbot86/implementations/src/master/java/src/algorithms/published
[7]
Brian F Cooper, Adam Silberstein, Erwin Tam, Raghu Ramakrishnan, and Russell Sears. 2010. Benchmarking cloud serving systems with YCSB. In SoCC. https://doi.org/10.1145/1807128.1807152
[8]
Benoit Daloze, Arie Tal, Stefan Marr, Hanspeter Mössenböck, and Erez Petrank. 2018. Parallelization of dynamic languages: synchronizing built-in collections. Proceedings of the ACM on Programming Languages, 2, OOPSLA (2018), https://doi.org/10.1145/3276478
[9]
Faith Ellen, Panagiota Fatourou, Eric Ruppert, and Franck van Breugel. 2010. Non-blocking binary search trees. In PODC. https://doi.org/10.1145/1835698.1835736
[10]
Keir Fraser. 2004. Practical lock-freedom. Ph. D. Dissertation.
[11]
Timothy L Harris. 2001. A pragmatic implementation of non-blocking linked-lists. In DISC. https://doi.org/10.1007/3-540-45414-4_21
[12]
Steve Heller, Maurice Herlihy, Victor Luchangco, Mark Moir, William N Scherer, and Nir Shavit. 2005. A lazy concurrent list-based set algorithm. In OPODIS. https://doi.org/10.1007/11795490_3
[13]
Maurice Herlihy. 1991. Wait-free synchronization. TOPLAS, 13, 1 (1991), https://doi.org/10.1145/114005.102808
[14]
Maurice Herlihy, Yossi Lev, Victor Luchangco, and Nir Shavit. 2007. A simple optimistic skiplist algorithm. In SIROCCO. https://doi.org/10.1007/978-3-540-72951-8_11
[15]
Maurice Herlihy and Nir Shavit. 2008. The art of multiprocessor programming. Morgan Kaufmann.
[16]
Maurice Herlihy and Jeannette M. Wing. 1990. Linearizability: A correctness condition for concurrent objects. TOPLAS, 12, 3 (1990), https://doi.org/10.1145/78969.78972
[17]
Prasad Jayanti. 2005. An optimal multi-writer snapshot algorithm. In STOC. https://doi.org/10.1145/1060590.1060697
[18]
Leslie Lamport. 1979. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput., 28, 9 (1979), https://doi.org/10.1109/TC.1979.1675439
[19]
Doug Lea. 2004. The java concurrency package (JSR-166). http://gee.cs.oswego.edu/dl/concurrency-interest
[20]
Nancy A Lynch. 1996. Distributed algorithms. Elsevier.
[21]
Remigius Meier, Armin Rigo, and Thomas R Gross. 2016. Parallel virtual machines with RPython. In DLS. https://doi.org/10.1145/2989225.2989233
[22]
Jacob Nelson-Slivon, Ahmed Hassan, and Roberto Palmieri. 2022. Bundling linked data structures for linearizable range queries. In PPoPP. https://doi.org/10.1145/3503221.3508412
[23]
Erez Petrank and Shahar Timnat. 2013. Lock-free data-structure iterators. In DISC. https://doi.org/10.1007/978-3-642-41527-2_16
[24]
Yaron Riany, Nir Shavit, and Dan Touitou. 2001. Towards a practical snapshot algorithm. Theoretical Computer Science, 269, 1-2 (2001), https://doi.org/10.1016/S0304-3975(00)00412-6
[25]
Gal Sela, Maurice Herlihy, and Erez Petrank. 2021. Brief announcement: Linearizability: A typo. In PODC. https://doi.org/10.1145/3465084.3467944
[26]
Gal Sela, Maurice Herlihy, and Erez Petrank. 2021. Linearizability: A typo. arXiv preprint, arxiv:2105.06737.
[27]
Gal Sela and Erez Petrank. 2022. Concurrent Size. arXiv preprint, arxiv:2209.07100.
[28]
Gal Sela and Erez Petrank. 2022. Concurrent Size - Artifact for OOPSLA’22. https://doi.org/10.5281/zenodo.7079982
[29]
Nir Shavit and Asaph Zemach. 1996. Diffracting trees. TOCS, 14, 4 (1996), https://doi.org/10.1145/235543.235546
[30]
Håkan Sundell and Philippas Tsigas. 2005. Fast and lock-free concurrent priority queues for multi-thread systems. J. Parallel and Distrib. Comput., 65, 5 (2005), https://doi.org/10.1016/j.jpdc.2004.12.005
[31]
Yuanhao Wei. 2021. vcaslib. https://github.com/yuanhaow/vcaslib
[32]
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 PPoPP. https://doi.org/10.1145/3437801.3441602

Cited By

View all
  • (2024)Concurrent Size (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673409(1-2)Online publication date: 17-Jun-2024

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 6, Issue OOPSLA2
October 2022
1932 pages
EISSN:2475-1421
DOI:10.1145/3554307
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 31 October 2022
Published in PACMPL Volume 6, Issue OOPSLA2

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Concurrent Algorithms
  2. Concurrent Data Structures
  3. Linearizability
  4. Size
  5. Wait-Freedom

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)146
  • Downloads (Last 6 weeks)17
Reflects downloads up to 18 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Concurrent Size (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673409(1-2)Online publication date: 17-Jun-2024

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media