The function "SetKeyValue" must be multi-thread safe when writing new items! This means writing the Key last and atomically, or writing the entire EntryType in a single write (say if the key and value are packed into a single integer word). Inline is recommended, since these functions are called a lot in the inner loop of the algorithm. A simple implementation of "KeyHash" can just return the Key (if it's already reasonable as a hash), or mix the bits if better distribution is required. A simple implementation of "ClearEntries" can just be a memset, if zero represents an empty entry.