On Tue, 14 Mar 2006, Libin Varghese wrote:
> I am not able to understand the hashing algorithm < static UInt
> hash_LockSet_w_wo(const LockSet *ls, const Mutex *with, const Mutex *without)
>> used for the Locksets. So could someone please explain it to me.
Looks like it just goes through the lockset and, for each entry, if it
matches some criteria does some bit fiddling (left rotate and XORing).
> Also please tell why is "LOCKSET_HASH_SZ" 1021, I mean why this number. Is
> it because it is a prime number or are considering only 1021 locksets as
> of now?
I think because it's prime. Standard technique for hash tables.
Nick
|