enum lfds710_hash_a_query

From liblfds.org
Jump to navigation Jump to search

Source File



enum lfds710_hash_a_query



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


Validates the hash, by issuing a validation query on every btree in the hash. Additionally, if given an expected range of the number of elements in the hash, counts the number of elements in the hash and checks they fall within the expected range. The validation queries to the btrees are thread-safe, but the count is not and if other threads are adding elements to the hash, 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.


By singlethreaded, it is meant to say that the action performed will only be accurate if there are no threads performing write operations (i.e. linking new elements) for the duration of the operation.

See Also