Skip to main content

Concurrent Lock-Free Unbounded Priority Queue with Mutable Priorities

  • Conference paper
  • First Online:
Stabilization, Safety, and Security of Distributed Systems (SSS 2018)

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

Abstract

The priority queue with DeleteMin and Insert operations is a classical interface for ordering items associated with priorities. Some important algorithms, such as Dijkstra’s single-source-shortest-path, Adaptive Huffman Trees, etc. also require changing the priorities of items in the runtime. Existing lock-free priority queues do not directly support the dynamic mutation of the priorities. This paper presents the first concurrent lock-free unbounded binary heap that implements a priority queue with mutable priorities. The operations are provably linearizable. We also designed an optimized version of the algorithm by combining the concurrent operations that substantially improves the performance. For experimental evaluation, we implemented the algorithm in both C/C++ and Java. A number of micro-benchmarks show that our algorithm performs well in comparison to existing implementations.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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.

    In this work, by a heap we mean a binary heap.

  2. 2.

    SC2 which validates and writes to two disjoint memory locations atomically.

  3. 3.

    In our implementation, the Insert operations never returns a \(null\) or fails to make any change due to the reason of finding the heap full. The heap is never full as long as we have sufficient system memory available.

References

  1. Alistarh, D., Kopinsky, J., Li, J., Shavit, N.: The spraylist: a scalable relaxed priority queue. In: ACM SIGPLAN Notices, vol. 50, pp. 11–20. ACM (2015)

    Google Scholar 

  2. Barnes, G.: A method for implementing lock-free shared-data structures. In: 5th SPAA, pp. 261–270 (1993)

    Google Scholar 

  3. Barnes, G.: Wait-free Algoritzms for Heaps. Department of Computer Science and Engineering, University of Washington (1994)

    Google Scholar 

  4. David, T., Guerraoui, R., Trigonakis, V.: Asynchronized concurrency: The secret to scaling concurrent search data structures. In: 20th ASPLOS, pp. 631–644 (2015)

    Article  Google Scholar 

  5. de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78800-3_24

    Chapter  Google Scholar 

  6. Dechev, D., Pirkelbauer, P., Stroustrup, B.: Lock-free dynamically resizable arrays. In: Shvartsman, M.M.A.A. (ed.) OPODIS 2006. LNCS, vol. 4305, pp. 142–156. Springer, Heidelberg (2006). https://doi.org/10.1007/11945529_11

    Chapter  Google Scholar 

  7. Dijkstra, E.W.: A note on two problems in connexion with graphs. Numer. Math. 1(1), 269–271 (1959)

    Article  MathSciNet  Google Scholar 

  8. Dragicevic, K., Bauer, D.: Optimization techniques for concurrent STM-based implementations: a concurrent binary heap as a case study. In: 23rd IPDPS, pp. 1–8 (2009)

    Google Scholar 

  9. Fraser, K.: Practical lock-freedom. Ph.D. thesis, University of Cambridge (2004)

    Google Scholar 

  10. Fujimoto, R.M.: Parallel discrete event simulation. Commun. ACM 33(10), 30–53 (1990)

    Article  Google Scholar 

  11. Gidenstam, A., Papatriantafilou, M., Sundell, H., Tsigas, P.: Efficient and reliable lock-free memory reclamation based on reference counting. IEEE Trans. Parallel Distrib. Syst. 20(8), 1173–1187 (2009)

    Article  Google Scholar 

  12. Hendler, D., Shavit, N., Yerushalmi, L.: A scalable lock-free stack algorithm. In: 16th SPAA, SPAA 2004, pp. 206–215 (2004)

    Google Scholar 

  13. Henry, G.J.: The unix system: the fair share scheduler. AT&T Bell Lab. Tech. J. 63(8), 1845–1857 (1984)

    Article  Google Scholar 

  14. Herlihy, M.: Wait-free synchronization. ACM TOPLAS 13(1), 124–149 (1991)

    Article  Google Scholar 

  15. Herlihy, M.: A methodology for implementing highly concurrent data objects. ACM Trans. Program. Lang. Syst. 15(5), 745–770 (1993)

    Article  Google Scholar 

  16. Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM TOPLAS 12(3), 463–492 (1990)

    Article  Google Scholar 

  17. 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)

    Article  MathSciNet  Google Scholar 

  18. Israeli, A., Rappoport, L.: Efficient wait-free implementation of a concurrent priority queue. In: Schiper, A. (ed.) WDAG 1993. LNCS, vol. 725, pp. 1–17. Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-57271-6_23

    Chapter  Google Scholar 

  19. Michael, M.M.: Hazard pointers: safe memory reclamation for lock-free objects. IEEE Trans. Parallel Distrib. Syst. 15(6), 491–504 (2004)

    Article  Google Scholar 

  20. Prim, R.C.: Shortest connection networks and some generalizations. Bell Labs Tech. J. 36(6), 1389–1401 (1957)

    Article  Google Scholar 

  21. Shavit, N., Lotan, I.: Skiplist-based concurrent priority queues. In: 14th IPDPS, pp. 263–268. IEEE (2000)

    Google Scholar 

  22. Shavit, N., Touitou, D.: Software transactional memory. Distrib. Comput. 10(2), 99–116 (1997)

    Article  Google Scholar 

  23. Sundell, H., Tsigas, P.: Fast and lock-free concurrent priority queues for multi-thread systems. J. Parallel Distrib. Comput. 65(5), 609–627 (2005)

    Article  Google Scholar 

  24. Tamir, O., Morrison, A., Rinetzky, N.: A heap-based concurrent priority queue with mutable priorities for faster parallel algorithms. In: 19th OPODIS (2016)

    Google Scholar 

  25. Vitter, J.S.: Design and analysis of dynamic huffman codes. J. ACM (JACM) 34(4), 825–845 (1987)

    Article  MathSciNet  Google Scholar 

  26. Walulya, I., Chatterjee, B., Datta, A.K., Niyoliya, R., Tsigas, P.: Concurrent lock-free unbounded priority queue with mutable priorities. Technical report, 2018:06, ISNN 1652–926X, Department of Computer Science and Engineering, Chalmers University of Technology (2018)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ivan Walulya .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Walulya, I., Chatterjee, B., Datta, A.K., Niyolia, R., Tsigas, P. (2018). Concurrent Lock-Free Unbounded Priority Queue with Mutable Priorities. In: Izumi, T., Kuznetsov, P. (eds) Stabilization, Safety, and Security of Distributed Systems. SSS 2018. Lecture Notes in Computer Science(), vol 11201. Springer, Cham. https://doi.org/10.1007/978-3-030-03232-6_24

Download citation

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

  • Published:

  • Publisher Name: Springer, Cham

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

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics