Lock-Free and Practical Doubly Linked List-Based Deques Using Single-Word Compare-and-Swap

  • Håkan Sundell
  • Philippas Tsigas
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3544)

Abstract

We present an efficient and practical lock-free implementation of a concurrent deque that supports parallelism for disjoint accesses and uses atomic primitives which are available in modern computer systems. Previously known lock-free algorithms of deques are either based on non-available atomic synchronization primitives, only implement a subset of the functionality, or are not designed for disjoint accesses. Our algorithm is based on a general lock-free doubly linked list, and only requires single-word compare-and-swap atomic primitives. It also allows pointers with full precision, and thus supports dynamic deque sizes. We have performed an empirical study using full implementations of the most efficient known algorithms of lock-free deques. For systems with low concurrency, the algorithm by Michael shows the best performance. However, as our algorithm is designed for disjoint accesses, it performs significantly better on systems with high concurrency and non-uniform memory architecture. In addition, the proposed solution also implements a general doubly linked list, the first lock-free implementation that only needs the single-word compare-and-swap atomic primitive.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Silberschatz, A., Galvin, P.: Operating System Concepts. Addison Wesley, Reading (1994)MATHGoogle Scholar
  2. 2.
    Herlihy, M.: Wait-free synchronization. ACM Transactions on Programming Languages and Systems 11, 124–149 (1991)CrossRefGoogle Scholar
  3. 3.
    Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free synchronization: Double-ended queues as an example. In: Proceedings of the 23rd International Conference on Distributed Computing Systems (2003)Google Scholar
  4. 4.
    Arora, N.S., Blumofe, R.D., Plaxton, C.G.: Thread scheduling for multiprogrammed multiprocessors. In: ACM Symposium on Parallel Algorithms and Architectures, pp. 119–129 (1998)Google Scholar
  5. 5.
    Greenwald, M.: Non-Blocking Synchronization and System Design. PhD thesis, Stanford University, Palo Alto, CA (1999)Google Scholar
  6. 6.
    Greenwald, M.: Two-handed emulation: how to build non-blocking implementations of complex data-structures using DCAS. In: Proceedings of the twenty-first annual symposium on Principles of distributed computing, pp. 260–269. ACM Press, New York (2002)CrossRefGoogle Scholar
  7. 7.
    Agesen, O., Detlefs, D., Flood, C.H., Garthwaite, A., Martin, P., Shavit, N., Steele Jr., G.L.: DCAS-based concurrent deques. In: ACM Symposium on Parallel Algorithms and Architectures, pp. 137–146 (2000)Google Scholar
  8. 8.
    Detlefs, D., Flood, C.H., Garthwaite, A., Martin, P., Shavit, N., Steele Jr., G.L.: Even better DCAS-based concurrent deques. In: International Symposium on Distributed Computing, pp. 59–73 (2000)Google Scholar
  9. 9.
    Martin, P., Moir, M., Steele, G.: DCAS-based concurrent deques supporting bulk allocation. Technical Report TR-2002-111, Sun Microsystems (2002)Google Scholar
  10. 10.
    Valois, J.D.: Lock-Free Data Structures. PhD thesis, Rensselaer Polytechnic Institute, Troy, New York (1995)Google Scholar
  11. 11.
    Michael, M.M.: CAS-based lock-free algorithm for shared deques. In: Kosch, H., Böszörményi, L., Hellwagner, H. (eds.) Euro-Par 2003. LNCS, vol. 2790, pp. 651–660. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  12. 12.
    Sundell, H., Tsigas, P.: Lock-free and practical deques using single-word compare-and-swap. Technical Report 2004-02, Computing Science, Chalmers University of Technology (2004)Google Scholar
  13. 13.
    Herlihy, M., Wing, J.: Linearizability: a correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems 12, 463–492 (1990)CrossRefGoogle Scholar
  14. 14.
    Detlefs, D., Martin, P., Moir, M., Steele Jr., G.: Lock-free reference counting. In: Proceedings of the 20th Annual ACM Symposium on Principles of Distributed Computing (2001)Google Scholar
  15. 15.
    Harris, T., Fraser, K., Pratt, I.: A practical multi-word compare-and-swap operation. In: Proceedings of the 16th International Symposium on Distributed Computing (2002)Google Scholar
  16. 16.
    Harris, T.L.: A pragmatic implementation of non-blocking linked lists. In: Proceedings of the 15th International Symposium of Distributed Computing, pp. 300–314 (2001)Google Scholar
  17. 17.
    Michael, M.M.: Safe memory reclamation for dynamic lock-free objects using atomic reads and writes. In: Proceedings of the 21st ACM Symposium on Principles of Distributed Computing, pp. 21–30 (2002)Google Scholar
  18. 18.
    Herlihy, M., Luchangco, V., Moir, M.: The repeat offender problem: A mechanism for supporting dynamic-sized, lock-free data structure. In: Proceedings of 16th International Symposium on Distributed Computing (2002)Google Scholar
  19. 19.
    Michael, M.M., Scott, M.L.: Correction of a memory management method for lock-free data structures. Technical report, Computer Science Department, University of Rochester (1995)Google Scholar
  20. 20.
    Sundell, H.: Efficient and Practical Non-Blocking Data Structures. PhD thesis, Department of Computing Science, Chalmers University of Technology (2004)Google Scholar
  21. 21.
    Sundell, H., Tsigas, P.: NOBLE: A non-blocking inter-process communication library. In: Proceedings of the 6th Workshop on Languages, Compilers and Run-time Systems for Scalable Computers (2002)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Håkan Sundell
    • 1
  • Philippas Tsigas
    • 1
  1. 1.Department of Computing ScienceChalmers University of Technology and Göteborg UniversityGöteborgSweden

Personalised recommendations