A Pragmatic Non-blocking Concurrent Directed Acyclic Graph

  • Sathya PeriEmail author
  • Muktikanta SaEmail author
  • Nandini SinghalEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11704)


In this paper, we have developed two non-blocking algorithms for maintaining acyclicity in a concurrent directed graph. The first algorithm is based on a wait-free reachability query and the second one on partial snapshot-based obstruction-free reachability query. Interestingly, we are able to achieve the acyclic property in a dynamic setting without (1) making use of helping descriptors by other threads, or (2) clean double collect mechanism. We present a proof to show that the graph remains acyclic at all times in the concurrent setting. We also prove that the acyclic graph data-structure operations are linearizable. We implement both the algorithms in C++ and test through several micro-benchmarks. Our experimental results illustrate an average of 7x improvement over the sequential and global-lock implementation.


Acyclic graph Concurrent data structure Linearizability Lock-freedom 



We would like to thank the anonymous reviewers and our shepherd, C. Aiswarya for their useful suggestions and comments. Following their suggestions, we made several improvements to the manuscript. This research was funded by MediaLab Asia for funding Graduate Scholarship.


  1. 1.
    Afek, Y., Attiya, H., Dolev, D., Gafni, E., Merritt, M., Shavit, N.: Atomic snapshots of shared memory. J. ACM 40(4), 873–890 (1993)CrossRefGoogle Scholar
  2. 2.
    Barnes, G.: A method for implementing lock-free shared-data structures. In: Proceedings of the Fifth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA 1993, pp. 261–270. ACM, New York (1993)Google Scholar
  3. 3.
    Brito, J., O’Sullivan, A.: Bitcoin: A Primer for Policymakers. Mercatus Center at George Mason University (2013)Google Scholar
  4. 4.
    Buterin, V.: Ethereum: a next generation smart contract and decentralized application platform (2013).
  5. 5.
    Chatterjee, B., Nguyen, N., Tsigas, P.: Efficient lock-free binary search trees. In: Proceedings of the 2014 ACM Symposium on Principles of Distributed Computing, PODC 2014, pp. 322–331. ACM, New York (2014)Google Scholar
  6. 6.
    Chatterjee, B., Peri, S., Sa, M., Singhal, N.: A simple and practical concurrent non-blocking unbounded graph with linearizable reachability queries. In: ICDCN 2019, pp. 168–177 (2019)Google Scholar
  7. 7.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. MIT Press, Cambridge (2009)zbMATHGoogle Scholar
  8. 8.
    Dang, N.N., Tsigas, P.: Progress guarantees when composing lock-free objects. In: Jeannot, E., Namyst, R., Roman, J. (eds.) Euro-Par 2011. LNCS, vol. 6853, pp. 148–159. Springer, Heidelberg (2011). Scholar
  9. 9.
    Demetrescu, C., Finocchi, I., Italiano, G.F.: Dynamic graphs. In: Handbook of Data Structures and Applications, Chapman and Hall/CRC (2004)Google Scholar
  10. 10.
    Fomitchev, M., Ruppert, E.: Lock-free linked lists and skip lists. In: Proceedings of the Twenty-Third Annual ACM Symposium on Principles of Distributed Computing, PODC 2004, St. John’s, Newfoundland, Canada, 25–28 July 2004, pp. 50–59 (2004)Google Scholar
  11. 11.
    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). Scholar
  12. 12.
    Hendler, D., Shavit, N., Yerushalmi, L.: A scalable lock-free stack algorithm. In: Proceedings of the Sixteenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2004, pp. 206–215. ACM, New York (2004)Google Scholar
  13. 13.
    Herlihy, M., Shavit, N.: On the nature of progress. In: Fernàndez Anta, A., Lipari, G., Roy, M. (eds.) OPODIS 2011. LNCS, vol. 7109, pp. 313–328. Springer, Heidelberg (2011). Scholar
  14. 14.
    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
  15. 15.
    Kallimanis, N.D., Kanellou, E.: Wait-free concurrent graph objects with dynamic traversals. In: OPODIS 2015, pp. 27:1–27:17 (2015)Google Scholar
  16. 16.
    Ladan-Mozes, E., Shavit, N.: An optimistic approach to lock-free FIFO queues. Distrib. Comput. 20(5), 323–341 (2008)CrossRefGoogle Scholar
  17. 17.
    Michael, M.M.: High performance dynamic lock-free hash tables and list-based sets. In: SPAA, pp. 73–82 (2002)Google Scholar
  18. 18.
    Nakamoto, S.: Bitcoin: a peer-to-peer electronic cash system (2008).
  19. 19.
    Natarajan, A., Mittal, N.: Fast concurrent lock-free binary search trees. In: ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2014, Orlando, FL, USA, 15–19 February 2014, pp. 317–328 (2014)Google Scholar
  20. 20.
    Peri, S., Sa, M., Singhal, N.: A pragmatic non-blocking concurrent directed acyclic graph. CoRR, abs/1611.03947 (2016)Google Scholar
  21. 21.
    Serguei Popov. The tangle (2018).
  22. 22.
    Sinha, A., Malik, S.: Runtime checking of serializability in software transactional memory. In: IPDPS 2010, pp. 1–12 (2010)Google Scholar
  23. 23.
    Valois, J.D.: Lock-free linked lists using compare-and-swap. In: Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, Ottawa, Ontario, Canada, 20–23 August 1995, pp. 214–222 (1995)Google Scholar
  24. 24.
    Weikum, G., Vossen, G.: Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery. Morgan Kaufmann, Burlington (2002)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Department of Computer Science and EngineeringIndian Institute of Technology HyderabadSangareddyIndia
  2. 2.Microsoft (R&D) Pvt. Ltd.BangaloreIndia

Personalised recommendations