tzaeschke / tinspin-indexes

Spatial index library with R*Tree, STR-Tree, Quadtree, CritBit, KD-Tree, CoverTree and PH-Tree
http://www.tinspin.org
Apache License 2.0
111 stars 24 forks source link

CopyOnWrite CritBit64 #2

Closed bvancea closed 9 years ago

bvancea commented 9 years ago

Updated the COW version of the CritBit to support atomic writes even when the tree has 0, 1 or 2 nodes.

This is done by keeping information like the size, root node reference and the root key/value references into a single object. This object can be updated atomically through a reference swap during the write methods.