Skip to main content

Logarithmic-Time Single Deleter, Multiple Inserter Wait-Free Queues and Stacks

  • Conference paper

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

Abstract

Despite the ubiquitous need for shared FIFO queues in parallel applications and operating systems, there are no sublinear-time wait-free queue algorithms that can support more than a single enqueuer and a single dequeuer. Two independently designed algorithms—David’s recent algorithm [1] and the algorithm in this paper—break this barrier. While David’s algorithm is capable of supporting multiple dequeuers (but only one enqueuer), our algorithm can support multiple enqueuers (but only one dequeuer). David’s algorithm achieves O(1) time complexity for both enqueue and dequeue operations, but its space complexity is infinite because of the use of infinite sized arrays. The author states that he can bound the space requirement, but only at the cost of increasing the time complexity to O(n), where n is the number of dequeuers. A significant feature of our algorithm is that its time and space complexities are both bounded and small: enqueue and dequeue operations run in \(O(\lg n)\) time, and the space complexity is O(n+m), where n is the number of enqueuers and m is the actual number of items currently present in the queue. David’s algorithm uses fetch&increment and swap instructions, which are both at level 2 of Herlihy’s Consensus hierarchy, along with queue. Our algorithm uses the LL/SC instructions, which are universal. However, since these instructions have constant time wait-free implementation from CAS and restricted LL/SC that are widely supported on modern architectures, our algorithms can run efficiently on current machines. Thus, in applications where there are multiple producers and a single consumer (e.g., certain server queues and resource queues), our algorithm provides the best known solution to implementing a wait-free queue. Using similar ideas, we can also efficiently implement a stack that supports multiple pushers and a single popper.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. David, M.: A single-enqueuer wait-free queue implementation. In: Proceedings of the 18th International Conference on Distributed Computing, pp. 132–143 (2004)

    Google Scholar 

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

    Article  Google Scholar 

  3. Herlihy, M.: A methodology for implementing highly concurrent data structures. ACM Transactions on Programming Languages and Systems 15, 745–770 (1993)

    Article  Google Scholar 

  4. Jayanti, P.: A lower bound on the local time complexity of universal constructions. In: Proceedings of the 17th Annual Symposium on Principles of Distributed Computing (1998)

    Google Scholar 

  5. Chandra, T., Jayanti, P., Tan, K.Y.: A polylog time wait-free construction for closed objects. In: Proceedings of the 17th Annual Symposium on Principles of Distributed Computing (1998)

    Google Scholar 

  6. Jayanti, P.: f-arrays: implementation and applications. In: Proceedings of the 21st Annual Symposium on Principles of Distributed Computing, pp. 270–279 (2002)

    Google Scholar 

  7. Anderson, J., Moir, M.: Universal constructions for large objects. In: Proceedings of the 9th International Workshop on Distributed Algorithms, pp. 168–182 (1995)

    Google Scholar 

  8. Jayanti, P., Petrovic, S.: Efficient and practical constructions of LL/SC variables. In: Proceedings of the 22nd ACM Symposium on Principles of Distributed Computing (2003)

    Google Scholar 

  9. Moir, M.: Practical implementations of non-blocking synchronization primitives. In: Proceedings of the 16th Annual ACM Symposium on Principles of Distributed Computing, pp. 219–228 (1997)

    Google Scholar 

  10. Afek, Y., Weisberger, E., Weisman, H.: A completeness theorem for a class of synchronization objects. In: Proceedings of the 12th Annual Symposium on Principles of Distributed Computing, pp. 159–170 (1993)

    Google Scholar 

  11. Li, Z.: Non-blocking implementation of queues in asynchronous distributed sharedmemory systems. Master’s thesis, University of Toronto (2001)

    Google Scholar 

  12. Lamport, L.: Specifying concurrent program modules. ACM Transactions on Programming Languages and Systems 5, 190–222 (1983)

    Article  MATH  Google Scholar 

  13. Michael, M., Scott, M.: Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In: Proceedings of the 15th Annual ACM Symposium on Principles of Distributed Computing, pp. 267–276 (1996)

    Google Scholar 

  14. Afek, Y., Dauber, D., Touitou, D.: Wait-free made fast. In: Proceedings of the 27th Annual ACM Symposium on Theory of Computing, pp. 538–547 (1995)

    Google Scholar 

  15. Michael, M., Scott, M.: Nonblocking algorithms and preemption-safe locking on multiprogrammed shared memory multiprocessors. Journal of Parallel and Distributed Computing, 1–26 (1998)

    Google Scholar 

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

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Jayanti, P., Petrovic, S. (2005). Logarithmic-Time Single Deleter, Multiple Inserter Wait-Free Queues and Stacks. In: Sarukkai, S., Sen, S. (eds) FSTTCS 2005: Foundations of Software Technology and Theoretical Computer Science. FSTTCS 2005. Lecture Notes in Computer Science, vol 3821. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11590156_33

Download citation

  • DOI: https://doi.org/10.1007/11590156_33

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-30495-1

  • Online ISBN: 978-3-540-32419-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics