UnionFind.ConcurrentSourceThis module offers a concurrent union-find data structure based on disjoint set forests, with path compression and linking by random index.
The current implementation requires Sys.word_size = 64.
'a elem is the type of elements, or references. Like the type of ordinary atomic references, 'a Atomic.t, this type supports the operations of creating a new reference, reading a reference, writing a reference, and testing whether two references are the same. Unlike ordinary references, this type also supports a form of merging: union merges two references, making them "the same reference". When two references are "the same", we say that they are equivalent.
update x f applies the function f to the content of the reference x. Because several attempts may be required, the function f may be invoked several times.
eq x y determines whether the references x and y are "the same reference". At any point in time, eq is an equivalence relation on references: it is reflexive, symmetric, and transitive. When two references x and y are merged by invoking union x y, they become the same reference: eq x y becomes true, and remains forever true.
If x and y are equivalent, then union x y has no effect and returns None.
Otherwise, union x y merges the references x and y. The content of one reference is unchanged, and becomes the content of the reference after this operation. The content of the other reference is returned by this operation.
In either case, after the call, eq x y is true.