A Lock-free Binary Trie

Jeremy Ko · 2024

A binary trie is a sequential data structure that maintains a dynamic set from the universe$\{0,\ \ldots,\ u-1\}$, supporting Search with$O(1)$worst-case step complexity, and Insert, Delete, and Predecessor with$O(\log u)$worst-case step complexity. We give a wait-free implementation of a relaxed binary trie, using read, write, CAS, and AND operations. It supports all oper-ations with the same worst-case step complexity as the sequential binary trie. However, predecessor operations may not return a key when there are concurrent update operations. We use this as a component of a lock-free, linearizable implementation of a binary trie. It supports Search with$O(1)$worst-case step complexity and Insert, Deleteand Predecessorwith$O(c^{2}+\log\ u)$amortized step complexity, where$c$is a measure of the contention. A lock-free binary trie is challenging to implement as compared to many other lock-free data structures because Insertand Deleteoperations perform a non-constant number of modifications to the binary trie in the worst-case to ensure the correctness of Predecessoroperations.

Read the paper · More papers on PaperTik