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.
Similar content being viewed by others
References
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)
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)
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)
Barnes, G.: A method for implementing lock-free shared-data structures. In: Proceedings ACM Symposium on Parallel Algorithms and Architectures, pp. 261–270 (1993)
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)
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)
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)
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)
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)
Brown, T., Helga, J.: Non-blocking k-ary search trees. In: Proceedings International Conference on Principles of Distributed Systems, pp. 207–221 (2011)
Cederman, D., Tsigas, P.: Supporting lock-free composition of concurrent data objects: moving data between containerss. IEEE Trans. Comput. 62(9), 1866–1878 (2013)
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)
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)
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)
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)
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)
Fraser, K.: Practical lock freedom. Ph.D. thesis, Cambridge University Computer Laboratory (2003)
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)
Goodchild, M.F.: Geographic information systems and science: today and tomorrow. Ann. GIS 15(1), 3–9 (2009)
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)
Harris, T., Larus, J., Rajwar, R.: Transactional Memory, 2nd edn. Morgan and Claypool Publishers, San Rafael (2010)
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)
Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)
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)
Morrison, D.R.: PATRICIA—practical algorithm to retrieve information coded in alphanumeric. J. ACM 15(4), 514–534 (1968)
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)
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)
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)
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)
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)
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)
Shafiei, N.: Non-blocking Patricia tries with replace operations. arXiv:1303.3626 (2012)
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)
Shavit, N., Touitou, D.: Software transactional memory. Distrib. Comput. 10(2), 99–116 (1997)
Sundell, H., Tsigas, P.: Scalable and lock-free concurrent dictionaries. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1438–1445 (2004)
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)
Zijlstra, P.: Concurrent pagecache. In: Linux Symposium, p. 311 (2007)
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
Corresponding author
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
About this article
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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00446-019-00347-1