Built-In Coloring for Highly-Concurrent Doubly-Linked Lists

  • Hagit Attiya
  • Eshcar Hillel
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4167)


This paper presents a novel approach for lock-free implementations of concurrent data structures, based on dynamically maintaining a coloring of the data structure’s items. Roughly speaking, the data structure’s operations are implemented by acquiring virtual locks on several items of the data structure and then making the changes atomically; this simplifies the design and provides clean functionality. The virtual locks are managed with cas or dcas primitives, and helping is used to guarantee progress; virtual locks are acquired according to a coloring order that decreases the length of waiting chains and increases concurrency. Coming back full circle, the legality of the coloring is preserved by having operations correctly update the colors of the items they modify.

The benefits of the scheme are demonstrated with new nonblocking implementations of doubly-linked list data structures: A dcas-based implementation of a doubly-linked list allowing insertions and removals anywhere, and cas-based implementations in which removals are allowed only at the ends of the list (insertions can occur anywhere).

The implementations possess several attractive features: they do not bound the list size, they do not leave accessible chains of garbage nodes, and they allow operations to proceed concurrently, without interfering with each other, if they are applied to non-adjacent nodes in the list.


Source Node Data Item Memory Location Step Complexity Concurrent Operation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Afek, Y., Merritt, M., Taubenfeld, G., Touitou, D.: Disentangling multi-object operations. In: PODC 1997, pp. 111–120 (1997)Google Scholar
  2. 2.
    Agesen, O., Detlefs, D., Flood, C.H., Garthwaite, A., Martin, P., Moir, M., Shavit, N., Steele Jr., G.L.: DCAS-based concurrent deques. Theory Comput. Syst. 35(3), 349–386 (2002)MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Arora, N.S., Blumofe, R.D., Plaxton, C.G.: Thread scheduling for multiprogrammed multiprocessors. Theory Comput. Syst. 34(2), 115–144 (2001)MATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Attiya, H., Dagan, E.: Improved implementations of binary universal operations. J. ACM 48(5), 1013–1037 (2001)CrossRefMathSciNetGoogle Scholar
  5. 5.
    Attiya, H., Hillel, E.: Built-in coloring for highly-concurrent doubly-linked lists (2006), Available from,
  6. 6.
    Attiya, H., Welch, J.: Distributed Computing Fundamentals, Simulations and Advanced Topics, 2nd edn. John Wiley & Sons, Chichester (2004)MATHGoogle Scholar
  7. 7.
    Barnes, G.: A method for implementing lock-free shared-data structures. In: SPAA 1993, pp. 261–270 (1993)Google Scholar
  8. 8.
    Detlefs, D.L., Flood, C.H., Garthwaite, A.T., Martin, P.A., Shavit, N.N., Steele Jr., G.L.: Even better DCAS-based concurrent deques. In: Herlihy, M.P. (ed.) DISC 2000. LNCS, vol. 1914, pp. 59–73. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  9. 9.
    Doherty, S., Detlefs, D., Grove, L., Flood, C.H., Luchangco, V., Martin, P., Moir, M., Shavit, N., Steele Jr., G.L.: DCAS is not a silver bullet for nonblocking algorithm design. In: SPAA 2004, pp. 216–224 (2004)Google Scholar
  10. 10.
    Fich, F.E., Luchangco, V., Moir, M., Shavit, N.N.: Obstruction-free step complexity: Lock-free DCAS as an example. In: Fraigniaud, P. (ed.) DISC 2005. LNCS, vol. 3724, pp. 493–494. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  11. 11.
    Greenwald, M.: Non-Blocking Synchronization and System Design. Ph.D thesis, Stanford University (August 1999)Google Scholar
  12. 12.
    Greenwald, M.: Two-handed emulation: how to build non-blocking implementations of complex data-structures using DCAS. In: PODC 2002, pp. 260–269 (2002)Google Scholar
  13. 13.
    Harris, T., Fraser, K.: Language support for lightweight transactions. In: OOPSLA 2003, pp. 388–402 (2003)Google Scholar
  14. 14.
    Harris, T.L.: A pragmatic implementation of non-blocking linked-lists. In: Welch, J.L. (ed.) DISC 2001. LNCS, vol. 2180, pp. 300–314. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  15. 15.
    Herlihy, M.: Wait-free synchronization. ACM Trans. Program. Lang. Syst. 13(1), 124–149 (1991)CrossRefGoogle Scholar
  16. 16.
    Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free synchronization: Double-ended queues as an example. In: ICDCS 2003, pp. 522–529 (2003)Google Scholar
  17. 17.
    Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)CrossRefGoogle Scholar
  18. 18.
    IBM. IBM System/370 Extended Architecture, Principle of Operation, 1983. IBM Publication No. SA22-7085 (1983)Google Scholar
  19. 19.
    Israeli, A., Rappoport, L.: Disjoint-access-parallel implementations of strong shared memory primitives. In: PODC 1994, pp. 151–160 (1994)Google Scholar
  20. 20.
    Michael, M.: High performance dynamic lock-free hash tables and list-based sets. In: SPAA 2002, pp. 73–82. ACM Press, New York (2002)CrossRefGoogle Scholar
  21. 21.
    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
  22. 22.
    Shavit, N., Touitou, D.: Software transactional memory. Dist. Comp. 10(2), 99–116 (1997)CrossRefGoogle Scholar
  23. 23.
    Sundell, H.: Efficient and Practical Non-Blocking Data Structures. Ph.D thesis, Chalmers University of Technology (2004)Google Scholar
  24. 24.
    Sundell, H., Tsigas, P.: Lock-free and practical doubly linked list-based deques using single-word compare-and-swap. In: Higashino, T. (ed.) OPODIS 2004. LNCS, vol. 3544, pp. 240–255. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  25. 25.
    Turek, J., Shasha, D., Prakash, S.: Locking without blocking: making lock based concurrent data structure algorithms nonblocking. In: PODS 1992, pp. 212–222 (1992)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Hagit Attiya
    • 1
  • Eshcar Hillel
    • 1
  1. 1.Department of Computer ScienceTechnion 

Personalised recommendations