|
cds
2.3.3
|
Option specifying random level generator. More...
#include <cds/intrusive/details/skip_list_base.h>
Option specifying random level generator.
The random level generator is an important part of skip-list algorithm. The node height in the skip-list have a probabilistic distribution where half of the nodes that have level i pointers also have level i+1 pointers (i = 0..30). The random level generator should provide such distribution.
The Type functor interface is:
where
c_nUpperBound - constant that specifies the upper bound of random number generated. The generator produces a number from range [0 .. c_nUpperBound) (upper bound excluded). c_nUpperBound must be no more than 32.random_generator() - the constructor of generator object initialises the generator instance (its internal state).unsigned int operator()() - the main generating function. Returns random level from range [0 .. c_nUpperBound - 1]Stateful generators are supported.
Available Type implementations: