Skip to main content
Log in

Non-blocking Patricia tries with replace operations

  • Published:
Distributed Computing Aims and scope Submit manuscript

Abstract

This paper presents a non-blocking Patricia trie implementation for an asynchronous shared-memory system using Compare&Swap. The trie is a linearizable implementation of a set and supports three update operations: insert adds an element to the trie, delete removes an element from the trie and replace replaces one element by another. The replace operation is interesting because it changes two different locations of a trie. We design a mechanism that allows the two changes of a replace operation to appear to be executed atomically. If all update operations modify different parts of the trie, they run completely concurrently. The implementation also supports a wait-free find operation, which only reads shared memory and never changes the data structure. Our implementation and its correctness proof are modular and can be adapted for other data structures. Empirically, we compare our algorithms to some existing tree-based set implementations and our results show that our trie performs consistently well in different scenarios.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

References

  1. Afek, Y., Kaplan, H., Korenfeld, B., Morrison, A., Tarjan, R.E.: CBTree: a practical concurrent self-adjusting search tree. In: Proceedings of the 26th International Symposium on Distributed Computing, pp. 1–15 (2012)

    Google Scholar 

  2. Arbel-Raviv, M., Brown, T.: POSTER: reuse, don’t recycle: transforming algorithms that throw away descriptors. In: Proceedings of the 22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Austin, TX, USA, 4–8 Feb 2017, pp. 429–430 (2017)

  3. Aref, W.G., Ilyas, I.F.: SP-GiST: an extensible database index for supporting space partitioning trees. J. Intell. Inf. Syst. 17(2–3), 215–240 (2001)

    Article  Google Scholar 

  4. Barnes, G.: A method for implementing lock-free shared-data structures. In: Proceedings ACM Symposium on Parallel Algorithms and Architectures, pp. 261–270 (1993)

  5. Bieganski, P., Riedl, J., Carlis, J.V., Retzel, E.F.: Generalized suffix trees for biological sequence data: applications and implementation. In: Proceedings of the 27th Hawaii International Conference on System Sciences, pp. 35–44 (1994)

  6. Braginsky, A., Petrank, E.: A lock-free B+tree. In: Proceedings of the ACM Symposium on Parallelism in Algorithms and Architectures, pp. 58–67 (2012)

  7. Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: A practical concurrent binary search tree. In: Proceedings ACM Symposium on Principles and Practice of Parallel Programming, pp. 257–268 (2010)

  8. Brown, T., Ellen, F., Ruppert, E.: Pragmatic primitives for non-blocking data structures. In: Proceedings of the 32nd ACM Symposium on Principles of Distributed Computing, PODC’13, pp. 13–22 (2013)

  9. Brown, T., Ellen, F., Ruppert, E.: A general technique for non-blocking trees. In: Proceedings of the 19th ACM Symposium on Principles and Practice of Parallel Programming, PPOPP’14, pp. 329–342 (2014)

  10. Brown, T., Helga, J.: Non-blocking k-ary search trees. In: Proceedings International Conference on Principles of Distributed Systems, pp. 207–221 (2011)

    Google Scholar 

  11. Cederman, D., Tsigas, P.: Supporting lock-free composition of concurrent data objects: moving data between containerss. IEEE Trans. Comput. 62(9), 1866–1878 (2013)

    Article  MathSciNet  Google Scholar 

  12. 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’14, pp. 322–331 (2014)

  13. Drachsler, D., Vechev, M., Yahav, E.: Practical concurrent binary search trees via logical ordering. In: Proceedings of the 19th ACM Symposium on Principles and Practice of Parallel Programming, PPoPP’14, pp. 343–356 (2014)

  14. Ellen, F., Fatourou, P., Kosmas, E., Milani, A., Travers, C.: Universal constructions that ensure disjoint-access parallelism and wait-freedom. Distrib. Comput. 29(4), 251–277 (2016)

    Article  MathSciNet  Google Scholar 

  15. Ellen, F., Fatourou, P., Ruppert, E., van Breugel, F.: Non-blocking binary search trees. In: Proceedings of the 29th ACM Symposium on Principles of Distributed Computing, pp. 131–140 (2010)

  16. Fomitchev, M., Ruppert, E.: Lock-free linked lists and skip lists. In: Proceedings of the 23rd Annual ACM Symposium on Principles of Distributed Computing, pp. 50–59 (2004)

  17. Fraser, K.: Practical lock freedom. Ph.D. thesis, Cambridge University Computer Laboratory (2003)

  18. Gan, M., Zhang, M., Wang, S.: Extended negative association rules and the corresponding mining algorithm. In: Proceedings of the 4th International Conference on Advances in Machine Learning and Cybernetics, pp. 159–168 (2006)

    Chapter  Google Scholar 

  19. Goodchild, M.F.: Geographic information systems and science: today and tomorrow. Ann. GIS 15(1), 3–9 (2009)

    Article  Google Scholar 

  20. Guthaus, M.R., Ringenberg, J.S., Ernst, D., Austin, T.M., Mudge, T., Brown, R.B.: Mibench: a free, commercially representative embedded benchmark suite. In: Proceedings of the IEEE International Workshop Workload Characterization, pp. 3–14 (2001)

  21. Harris, T., Larus, J., Rajwar, R.: Transactional Memory, 2nd edn. Morgan and Claypool Publishers, San Rafael (2010)

    Google Scholar 

  22. Hart, T.E., McKenney, P.E., Brown, A.D., Walpole, J.: Performance of memory reclamation for lockless synchronization. J. Parallel Distrib. Comput. 67(12), 1270–1285 (2007)

    Article  Google Scholar 

  23. Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)

    Article  Google Scholar 

  24. Howley, S.V., Jones, J.: A non-blocking internal binary search tree. In: Proceedings of the ACM Symposium on Parallelism in Algorithms and Architectures, pp. 161–171 (2012)

  25. Morrison, D.R.: PATRICIA—practical algorithm to retrieve information coded in alphanumeric. J. ACM 15(4), 514–534 (1968)

    Article  Google Scholar 

  26. Natarajan, A., Mittal, N.: Fast concurrent lock-free binary search trees. In: Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP’14, pp. 317–328 (2014)

  27. Natarajan, A., Savoie, L., Mittal, N.: Concurrent wait-free red black trees. In: Proceedings of 15th International Symposium on Stabilization, Safety, and Security of Distributed Systems, SSS’13, pp. 45–60 (2013)

    Google Scholar 

  28. Oshman, R., Shavit, N.: The skiptrie: low-depth concurrent search without rebalancing. In: Proceedings of 32nd ACM Symposium on Principles of Distributed Computing, pp. 23–32 (2013)

  29. Pietracaprina, A., Zandolin, D.: Mining frequent itemsets using Patricia tries. In: Proceedings of the ICDM 2003 Workshop on Frequent Itemset Mining Implementations (2003). (Available as CEUR Workshop Proceedings Series, vol. 90, http://ceur-ws.org/vol-90)

  30. Prokopec, A., Bronson, N.G., Bagwell, P., Odersky, M.: Concurrent tries with efficient non-blocking snapshots. In: Proceedings ACM Symposium on Principles and Practice of Parallel Programming, pp. 151–160 (2012)

  31. Ramachandran, A., Mittal, N.: A fast lock-free internal binary search tree. In: Proceedings of the 2015 International Conference on Distributed Computing and Networking, ICDCN’15, pp. 37:1–37:10 (2015)

  32. Shafiei, N.: Non-blocking Patricia tries with replace operations. arXiv:1303.3626 (2012)

  33. Shafiei, N.: Non-blocking Patricia tries with replace operations. In: Proceedings of the 33rd International Conference on Distributed Computing Systems, ICDCS’13, pp. 216–225 (2013)

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

    Article  Google Scholar 

  35. Sundell, H., Tsigas, P.: Scalable and lock-free concurrent dictionaries. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1438–1445 (2004)

  36. Tsay, J.-J., Li, H.-C.: Lock-free concurrent tree structures for multiprocessor systems. In: Proceedings of the International Conference on Parallel and Distributed Systems, pp. 544–549 (1994)

  37. Zijlstra, P.: Concurrent pagecache. In: Linux Symposium, p. 311 (2007)

Download references

Acknowledgements

I thank my supervisor, Eric Ruppert for his great guidance, advice and support, Trevor Brown for providing lots of help and code for the experiments, Michael L. Scott for giving us access to his multicore machines and the anonymous referees for their constructive comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Niloufar Shafiei.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

A preliminary version of this paper appeared at ICDCS [33].

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Shafiei, N. Non-blocking Patricia tries with replace operations. Distrib. Comput. 32, 423–442 (2019). https://doi.org/10.1007/s00446-019-00347-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00446-019-00347-1

Keywords

Navigation