Advertisement

Non-blocking Patricia tries with replace operations

  • Niloufar ShafieiEmail author
Article
  • 3 Downloads

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.

Keywords

Patricia trie Non-blocking Shared memory Lock-free Concurrent data structure Dictionary Set 

Notes

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.

References

  1. 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. 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)Google Scholar
  3. 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)CrossRefzbMATHGoogle Scholar
  4. 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)Google Scholar
  5. 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)Google Scholar
  6. 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)Google Scholar
  7. 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)Google Scholar
  8. 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)Google Scholar
  9. 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)Google Scholar
  10. 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. 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)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 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)Google Scholar
  13. 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)Google Scholar
  14. 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)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 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)Google Scholar
  16. 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)Google Scholar
  17. 17.
    Fraser, K.: Practical lock freedom. Ph.D. thesis, Cambridge University Computer Laboratory (2003)Google Scholar
  18. 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)Google Scholar
  19. 19.
    Goodchild, M.F.: Geographic information systems and science: today and tomorrow. Ann. GIS 15(1), 3–9 (2009)CrossRefGoogle Scholar
  20. 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)Google Scholar
  21. 21.
    Harris, T., Larus, J., Rajwar, R.: Transactional Memory, 2nd edn. Morgan and Claypool Publishers, San Rafael (2010)Google Scholar
  22. 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)CrossRefzbMATHGoogle Scholar
  23. 23.
    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
  24. 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)Google Scholar
  25. 25.
    Morrison, D.R.: PATRICIA—practical algorithm to retrieve information coded in alphanumeric. J. ACM 15(4), 514–534 (1968)CrossRefGoogle Scholar
  26. 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)Google Scholar
  27. 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. 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)Google Scholar
  29. 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. 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)Google Scholar
  31. 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)Google Scholar
  32. 32.
    Shafiei, N.: Non-blocking Patricia tries with replace operations. arXiv:1303.3626 (2012)
  33. 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)Google Scholar
  34. 34.
    Shavit, N., Touitou, D.: Software transactional memory. Distrib. Comput. 10(2), 99–116 (1997)CrossRefzbMATHGoogle Scholar
  35. 35.
    Sundell, H., Tsigas, P.: Scalable and lock-free concurrent dictionaries. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1438–1445 (2004)Google Scholar
  36. 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)Google Scholar
  37. 37.
    Zijlstra, P.: Concurrent pagecache. In: Linux Symposium, p. 311 (2007)Google Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Department of Electrical Engineering and Computer ScienceYork UniversityTorontoCanada

Personalised recommendations