Ctrie
A concurrent hash-trie or Ctrie is a concurrent thread-safe lock-free implementation of a hash array mapped trie. It is used to implement the concurrent map abstraction. It has particularly scalable concurrent insert and remove operations and is memory-efficient. It is the first known concurrent data-structure that supports O(1), atomic, lock-free snapshots.
A concurrent hash-trie or Ctrie is a concurrent thread-safe lock-free implementation of a hash array mapped trie. It is used to implement the concurrent map abstraction. It has particularly scalable concurrent insert and remove operations and is memory-efficient. It is the first known concurrent data-structure that supports O(1), atomic, lock-free snapshots. bit = bmp & (1 > level) & 0x1F)) pos = bitcount((bit - 1) & bmp) Note that the operations treat only the I-nodes as mutable nodes - all other nodes are never changed after being created and added to the Ctrie. Below is an illustration of the pseudocode of the insert operation: def insert(k, v) r = READ(root) if iinsert(r, k, v, 0, null) = RESTART insert(k, v) def iinsert(i, k, v, lev, parent) cn = READ(i.main) flag, pos = flagpos(k.hc, lev, cn.bmp) if cn.bmp & flag = 0 { ncn = cn.inserted(pos, flag, SNode(k, v)) if CAS(i.main, cn, ncn) return OK else return RESTART } cn.array(pos) match { case sin: INode => { return iinsert(sin, k, v, lev + W, i) case sn: SNode => if sn.k ≠ k { nsn = SNode(k, v) nin = INode(CNode(sn, nsn, lev + W)) ncn = cn.updated(pos, nin) if CAS(i.main, cn, ncn) return OK else return RESTART } else { ncn = cn.updated(pos, SNode(k, v)) if CAS(i.main, cn, ncn) return OK else return RESTART } } The inserted and updated methods on nodes return new versions of the C-node with a value inserted or updated at the specified position, respectively. Note that the insert operation above is tail-recursive, so it can be rewritten as a while loop. Other operations are described in more detail in the original paper on Ctries. The data-structure has been proven to be correct - Ctrie operations have been shown to have the atomicity, linearizability and lock-freedom properties. The lookup operation can be modified to guarantee wait-freedom.
References
- Cache-Aware Lock-Free Concurrent Hash Tries . · 1762902000.0
- ctrie: Non-blocking concurrent hashmap for Haskell . · 1762902000.0
- triemap: Java port of . · 1762902000.0
- java-concurrent-hash-trie-map: Java port of a concurrent trie hash map implemen . · 1762902000.0
- cl-ctrie: lock-free, concurrent, key/value index with efficient memory-mapped persistence and fast transient storage models . · 1762902000.0
- A Lock-Free Hash Trie Design for Concurrent Tabled Logic Programs . · 1762902000.0
- ctrie: Documentation . · 1762902000.0
- uses hazard pointers in its implementation to achieve lock-free synchronization. * Both a managed and an unmanaged C++ version of Ctrie was implemented [https://github.com/mthom/managed-ctrie Managed . · 1762902000.0
- Concurrent Tries with Efficient Non-Blocking Snapshots . · 1762902000.0
- Lock-Free Resizeable Concurrent Tries . · 1762902000.0
- Ctrie - A Lock-Free Concurrent Hash Array Mapped Trie . · 1762902000.0
- Lock-Free Resizeable Concurrent Tries (Slideshow) . · 1762902000.0
- - Ctrie operations have been shown to have the atomicity, linearizability and lock-freedom properties. The lookup operation can be modified to guarantee wait-freedom. == Advantages of Ctries == Ct . · 1762902000.0
- for Scala 2.9.x is available on GitHub. It is a mutable thread-safe implementation which ensures progress and supports lock-free, linearizable, O(1) snapshots. * A data-structure similar to Ctries has . · 1762902000.0
- scala/src/library/scala/collection/concurrent/TrieMap.scala at 2.13.x . · 1762902000.0
- ctrie: Non-blocking concurrent map . · 1762902000.0
Cite this
"Ctrie". 1762908116. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1321686798 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy