enum lfds710_hash_a_query
Jump to navigation
Jump to search
Source File
└───liblfds710 └───inc └───liblfds710 lfds710_hash_addonly.h
Enum
enum lfds710_hash_a_query { LFDS710_HASH_A_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, LFDS710_HASH_A_QUERY_SINGLETHREADED_VALIDATE };
Values
LFDS710_HASH_A_QUERY_GET_POTENTIALLY_INACCURATE_COUNT
- 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.
LFDS710_HASH_A_QUERY_SINGLETHREADED_VALIDATE
- 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.
Notes
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.