Skip to main content

TSLQueue: An Efficient Lock-Free Design for Priority Queues

  • Conference paper
  • First Online:
Euro-Par 2021: Parallel Processing (Euro-Par 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12820))

Included in the following conference series:

Abstract

Priority queues are fundamental abstract data types, often used to manage limited resources in parallel systems. Typical proposed parallel priority queue implementations are based on heaps or skip lists. In recent literature, skip lists have been shown to be the most efficient design choice for implementing priority queues. Though numerous intricate implementations of skip list based queues have been proposed in the literature, their performance is constrained by the high number of global atomic updates per operation and the high memory consumption, which are proportional to the number of sub-lists in the queue.

In this paper, we propose an alternative approach for designing lock-free linearizable priority queues, that significantly improves memory efficiency and throughput performance, by reducing the number of global atomic updates and memory consumption as compared to skip-list based queues. To achieve this, our new design combines two structures; a search tree and a linked list, forming what we call a Tree Search List Queue (TSLQueue). The leaves of the tree are linked together to form a linked list of leaves with a head as an access point. Analytically, a skip-list based queue insert or delete operation has at worst case \(O(\log {}n)\) global atomic updates, where n is the size of the queue. While the TSLQueue insert or delete operations require only 2 or 3 global atomic updates respectively. When it comes to memory consumption, TSLQueue exhibits O(n) memory consumption, compared to \(O(n\log {}n)\) worst case for a skip-list based queue, making the TSLQueue more memory efficient than a skip-list based queue of the same size. We experimentally show, that TSLQueue significantly outperforms the best previous proposed skip-list based queues, with respect to throughput performance.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 99.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 129.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Quiescent consistency semantics allow weaker object behaviour than strong consistency models like linearizability to allow for better performance.

  2. 2.

    The ABA problem occurs when multiple processors access a shared location without noticing each others’ changes.

  3. 3.

    CAS atomically compares the contents of a memory location with a given value and, only if they are the same, modifies the contents of that memory location.

  4. 4.

    Fetch and xor atomically replaces the current value of a memory location with the result of bit-wise XOR of the memory location value, and returns the previous memory location value before the XOR.

References

  1. Alistarh, D., Kopinsky, J., Li, J., Shavit, N.: The SprayList: a scalable relaxed priority queue. ACM SIGPLAN Not. 50(8), 11–20 (2015). https://doi.org/10.1145/2858788.2688523

    Article  Google Scholar 

  2. Braginsky, A., Cohen, N., Petrank, E.: CBPQ: high performance lock-free priority queue. In: Dutot, P.-F., Trystram, D. (eds.) Euro-Par 2016. LNCS, vol. 9833, pp. 460–474. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-43659-3_34

    Chapter  Google Scholar 

  3. Calciu, I., Mendes, H., Herlihy, M.: The adaptive priority queue with elimination and combining. In: Kuhn, F. (ed.) DISC 2014. LNCS, vol. 8784, pp. 406–420. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-45174-8_28

    Chapter  Google Scholar 

  4. David, T., Guerraoui, R., Trigonakis, V.: Asynchronized concurrency: the secret to scaling concurrent search data structures. SIGARCH Comput. Archit. News 43(1), 631–644 (2015). https://doi.org/10.1145/2786763.2694359

    Article  Google Scholar 

  5. Deo, N., Prasad, S.: Parallel heap: an optimal parallel priority queue. J. Supercomput. 6(1), 87–98 (1992). https://doi.org/10.1007/BF00128644

    Article  MATH  Google Scholar 

  6. Dragicevic, K., Bauer, D.: Optimization techniques for concurrent STM-based implementations: a concurrent binary heap as a case study. In: 2009 IEEE International Symposium on Parallel Distributed Processing, pp. 1–8 (2009). https://doi.org/10.1109/IPDPS.2009.5161153

  7. Ellen, F., Fatourou, P., Helga, J., Ruppert, E.: The amortized complexity of non-blocking binary search trees. In: Proceedings of the 2014 ACM Symposium on Principles of Distributed Computing, PODC 2014, New York, NY, USA, pp. 332–340. Association for Computing Machinery (2014). https://doi.org/10.1145/2611462.2611486

  8. Harris, T.L.: A pragmatic implementation of non-blocking linked-lists. In: Welch, J. (ed.) DISC 2001. LNCS, vol. 2180, pp. 300–314. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45414-4_21

    Chapter  Google Scholar 

  9. Hendler, D., Incze, I., Shavit, N., Tzafrir, M.: Flat combining and the synchronization-parallelism tradeoff. In: Proceedings of the Twenty-Second Annual ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2010, New York, NY, USA, pp. 355–364. Association for Computing Machinery (2010). https://doi.org/10.1145/1810479.1810540

  10. Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2008)

    Google Scholar 

  11. Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990). https://doi.org/10.1145/78969.78972

    Article  Google Scholar 

  12. Hunt, G.C., Michael, M.M., Parthasarathy, S., Scott, M.L.: An efficient algorithm for concurrent priority queue heaps. Inf. Process. Lett. 60(3), 151–157 (1996). https://doi.org/10.1016/S0020-0190(96)00148-2

    Article  MathSciNet  MATH  Google Scholar 

  13. Lindén, J., Jonsson, B.: A skiplist-based concurrent priority queue with minimal memory contention. In: Baldoni, R., Nisse, N., van Steen, M. (eds.) OPODIS 2013. LNCS, vol. 8304, pp. 206–220. Springer, Cham (2013). https://doi.org/10.1007/978-3-319-03850-6_15

    Chapter  Google Scholar 

  14. Liu, Y., Spear, M.: Mounds: array-based concurrent priority queues. In: Proceedings of the 2012 41st International Conference on Parallel Processing, ICPP 2012, USA, pp. 1–10. IEEE Computer Society (2012). https://doi.org/10.1109/ICPP.2012.42

  15. Natarajan, A., Ramachandran, A., Mittal, N.: FEAST: a lightweight lock-free concurrent binary search tree. ACM Trans. Parallel Comput. 7(2), 1–64 (2020). https://doi.org/10.1145/3391438

    Article  Google Scholar 

  16. Pugh, W.: Skip lists: a probabilistic alternative to balanced trees. Commun. ACM 33(6), 668–676 (1990). https://doi.org/10.1145/78973.78977

    Article  Google Scholar 

  17. Rukundo, A., Tsigas, P.: Artifact and instructions to generate experimental results for the euro-par 2021 paper: Tslqueue: An efficient lock-free design for priority queues, August 2021. https://doi.org/10.6084/m9.figshare.14748420

  18. Shavit, N., Lotan, I.: Skiplist-based concurrent priority queues. In: Proceedings 14th International Parallel and Distributed Processing Symposium. IPDPS 2000, pp. 263–268 (2000). https://doi.org/10.1109/IPDPS.2000.845994

  19. Sundell, H., Tsigas, P.: Fast and lock-free concurrent priority queues for multi-thread systems. J. Parallel Distrib. Comput. 65(5), 609–627 (2005). https://doi.org/10.1016/j.jpdc.2004.12.005

    Article  MATH  Google Scholar 

  20. Tamir, O., Morrison, A., Rinetzky, N.: A heap-based concurrent priority queue with mutable priorities for faster parallel algorithms. In: 19th International Conference on Principles of Distributed Systems (OPODIS 2015), volume 46 of Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, pp. 1–16. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2016). https://doi.org/10.4230/LIPIcs.OPODIS.2015.15

  21. Valois, J.D.: Lock-free linked lists using compare-and-swap. In: Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, PODC 1995, New York, NY, USA, pp. 214–222. ACM (1995). https://doi.org/10.1145/224964.224988

  22. Zhang, D., Dechev, D.: A lock-free priority queue design based on multi-dimensional linked lists. IEEE Trans. Parallel Distrib. Syst. 27(3), 613–626 (2016). https://doi.org/10.1109/TPDS.2015.2419651

    Article  Google Scholar 

Download references

Acknowledgements and Data Availability Statement

The data sets and code generated and/or analysed during the current study are available in the Figshare repository: https://doi.org/10.6084/m9.figshare.14748420 [17]. This work has been supported by SIDA/Bright Project (317) under the Makerere-Sweden bilateral research programme 2015–2020, Mbarara University of Science and Technology and Swedish Research Council (Vetenskapsrådet) Under Contract No.: 2016-05360.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Adones Rukundo .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rukundo, A., Tsigas, P. (2021). TSLQueue: An Efficient Lock-Free Design for Priority Queues. In: Sousa, L., Roma, N., Tomás, P. (eds) Euro-Par 2021: Parallel Processing. Euro-Par 2021. Lecture Notes in Computer Science(), vol 12820. Springer, Cham. https://doi.org/10.1007/978-3-030-85665-6_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-85665-6_24

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-85664-9

  • Online ISBN: 978-3-030-85665-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics