skip to main content
10.1145/3491003.3491004acmotherconferencesArticle/Chapter ViewAbstractPublication PagesicdcnConference Proceedingsconference-collections
research-article

A Fast Wait-Free Multi-Producers Single-Consumer Queue

Published:24 January 2022Publication History

ABSTRACT

In sharded data processing systems, sharded in-memory key-value stores, data flow programming and load sharing, multiple concurrent data producers feed requests into the same data consumer. This can be naturally realized through concurrent queues, where each consumer pulls its tasks from its dedicated queue. For scalability, wait-free queues are preferred over lock based structures.

The vast majority of wait-free queue implementations, and even lock-free ones, support the multi-producer multi-consumer model. Yet, this comes at a premium, since implementing wait-free multi-producer multi-consumer queues requires utilizing complex helper data structures. The latter increases the memory consumption of such queues and limits their performance and scalability. Many such designs employ (hardware) cache unfriendly access patterns.

In this work we study the implementation of wait-free multi-producer single-consumer queues. Specifically, we propose Jiffy, an efficient memory frugal novel wait-free multi-producer single-consumer queue and formally prove its correctness. We compare the performance and memory requirements of Jiffy with other state of the art lock-free and wait-free queues. We show that indeed Jiffy can maintain good performance with up to 128 threads, delivers up to 50% better throughput than the next best construction we compared against, and consumes ≈ 90% less memory.

References

  1. Dolev Adas. 2020. Jiffy’s C++ Implementation. (2020). https://github.com/DolevAdas/Jiffy.Google ScholarGoogle Scholar
  2. Dolev Adas and Roy Friedman. 2020. A Fast Wait-Free Multi-Producers Single-Consumer Queue. CoRR abs/2010.14189(2020).Google ScholarGoogle Scholar
  3. Dan Alistarh, Justin Kopinsky, Jerry Li, and Nir Shavit. 2015. The Spraylist: A Scalable Relaxed Priority Queue. In Proc. of the ACM PPoPP. 11–20.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. James Aspnes and Maurice Herlihy. 1990. Wait-Free Data Structures in the Asynchronous PRAM Model. In Proc. of ACM SPAA. 340–349.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Keren Censor-Hillel, Erez Petrank, and Shahar Timnat. 2015. Help!. In Proc. of ACM PODC. 241–250.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Matei David. 2004. A Single-Enqueuer Wait-Free Queue Implementation. In International Symposium on Distributed Computing. Springer, 132–143.Google ScholarGoogle ScholarCross RefCross Ref
  7. Tudor David, Aleksandar Dragojevic, Rachid Guerraoui, and Igor Zablotchi. 2018. Log-Free Concurrent Data Structures. In USENIX ATC. 373–386.Google ScholarGoogle Scholar
  8. Panagiota Fatourou and Nikolaos D Kallimanis. 2012. Revisiting the Combining Synchronization Technique. In Proc. of the ACM PPoPP. 257–266.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. John Giacomoni, Tipp Moseley, and Manish Vachharajani. 2008. FastForward for Efficient Pipeline Parallelism: a Cache-Optimized Concurrent Lock-Free Queue. In Proc. of the ACM PPoPP. 43–52.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Mohammad Hedayati, Kai Shen, Michael L. Scott, and Mike Marty. 2019. Multi-Queue Fair Queuing. In USENIX Annual Technical Conference (ATC). 301–314.Google ScholarGoogle Scholar
  11. Maurice Herlihy. 1991. Wait-Free Synchronization. ACM Transactions on Programming Languages and Systems (TOPLAS) 13, 1(1991), 124–149.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Maurice Herlihy and Nir Shavit. 2011. The Art of Multiprocessor Programming. Morgan Kaufmann.Google ScholarGoogle Scholar
  13. Maurice P Herlihy and Jeannette M Wing. 1990. Linearizability: A Correctness Condition for Concurrent Objects. ACM Transactions on Programming Languages and Systems (TOPLAS) 12, 3(1990), 463–492.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Prasad Jayanti and Srdjan Petrovic. 2005. Logarithmic-Time Single Deleter, Multiple Inserter Wait-Free Queues and Stacks. In International Conference on Foundations of Software Technology and Theoretical Computer Science. Springer, 408–419.Google ScholarGoogle Scholar
  15. Alex Kogan and Erez Petrank. 2011. Wait-Free Queues with Multiple Enqueuers and Dequeuers. In Proc. of the ACM PPoPP. 223–234.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Alex Kogan and Erez Petrank. 2012. A Methodology for Creating Fast Wait-Free Data Structures. In Proc. of the ACM PPoPP. 141–150.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Edya Ladan-Mozes and Nir Shavit. 2004. An Optimistic Approach to Lock-Free FIFO Queues. In Proc. of DISC. 117–131.Google ScholarGoogle ScholarCross RefCross Ref
  18. Nhat Minh Lê, Adrien Guatto, Albert Cohen, and Antoniu Pop. 2013. Correct and Efficient Bounded FIFO Queues. In 25th International Symposium on Computer Architecture and High Performance Computing. IEEE, 144–151.Google ScholarGoogle Scholar
  19. Xue Liu and Wenbo He. 2007. Active Queue Management Design Using Discrete-Event Control. In 46th IEEE Conference on Decision and Control. 3806–3811.Google ScholarGoogle Scholar
  20. Ben Manes. 2017. Caffeine: A High Performance Caching Library for Java 8. (2017). https://github.com/ben-manes/caffeine.Google ScholarGoogle Scholar
  21. Maged M. Michael and Michael L. Scott. 1996. Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms. In ACM PODC. 267–275.Google ScholarGoogle Scholar
  22. Gal Milman, Alex Kogan, Yossi Lev, Victor Luchangco, and Erez Petrank. 2018. BQ: A Lock-Free Queue with Batching. In Proceedings of the ACM SPAA. 99–109.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Adam Morrison and Yehuda Afek. 2013. Fast Concurrent Queues for x86 Processors. In Proc. of the ACM PPoPP. 103–112.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Nicholas Nethercote and Julian Seward. 2003. Valgrind: A Program Supervision Framework. Electronic notes in theoretical computer science 89, 2 (2003), 44–66.Google ScholarGoogle ScholarCross RefCross Ref
  25. William N. Scherer, Doug Lea, and Michael L. Scott. 2006. Scalable Synchronous Queues. In Proceedings of the ACM PPOPP. 147–156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Michael L. Scott. 2002. Non-Blocking Timeout in Scalable Queue-Based Spin Locks. In Proceedings of ACM PODC. 31–40.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Michael L. Scott and William N. Scherer. 2001. Scalable Queue-Based Spin Locks with Timeout. In Proceedings of the ACM PPOPP. 44–52.Google ScholarGoogle Scholar
  28. Niloufar Shafiei. 2009. Non-Blocking Array-Based Algorithms for Stacks and Queues. In Proceedings of ICDCN. Springer, 55–66.Google ScholarGoogle Scholar
  29. Nir Shavit and Asaph Zemach. 1999. Scalable Concurrent Priority Queue Algorithms. In Proceedings of the ACM PODC. 113–122.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Foteini Strati, Christina Giannoula, Dimitrios Siakavaras, Georgios I. Goumas, and Nectarios Koziris. 2019. An Adaptive Concurrent Priority Queue for NUMA Architectures. In Proceedings of the 16th ACM International Conference on Computing Frontiers (CF). 135–144.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Philippas Tsigas and Yi Zhang. 2001. A Simple, Fast and Scalable Non-Blocking Concurrent FIFO Queue for Shared Memory Multiprocessor Systems. In ACM SPAA. 134–143.Google ScholarGoogle Scholar
  32. Hans Vandierendonck, Kallia Chronaki, and Dimitrios S Nikolopoulos. 2013. Deterministic Scale-Free Pipeline Parallelism with Hyperqueues. In Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis. ACM, 32.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Chaoran Yang and John Mellor-Crummey. 2016. A Wait-Free Queue as Fast as Fetch-and-Add. Proc. of the ACM PPoPP 51, 8 (2016), 16.Google ScholarGoogle Scholar

Index Terms

  1. A Fast Wait-Free Multi-Producers Single-Consumer Queue
        Index terms have been assigned to the content through auto-classification.

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Other conferences
          ICDCN '22: Proceedings of the 23rd International Conference on Distributed Computing and Networking
          January 2022
          298 pages
          ISBN:9781450395601
          DOI:10.1145/3491003

          Copyright © 2022 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 24 January 2022

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format