enum lfds711_btree_au_query

From liblfds.org
Revision as of 18:11, 16 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_btree_addonly_unbalanced.h

Enum

enum lfds711_btree_au_query
{
  LFDS711_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT,
  LFDS711_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE
};

Values

LFDS711_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT

Performs a single-threaded count of the number of elements in the btree. The count will only be guaranteed to be accurate if no other threads are adding elements to the tree during the count. If other threads are adding elements, they will only be counted if the tree walk which is counting elements has not yet reached those new elements.

LFDS711_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE

Validates the btree. Performs an in-order walk, checking every element is larger than the preceeding element. Additionally, if given an expected range of the number of elements in the tree, counts the number of elements in the tree and checks they fall within the expected range. The validation walk is thread-safe, but the count is not and if other threads are adding elements to the tree, they will not necessarily be counted, and so this could then lead to the count being improperly outside the count range specified by the caller.

Notes

This enum is used by the btree query function, lfds711_btree_au_query.

See Also