|
From: Libin V. <li...@gm...> - 2006-03-14 15:12:22
|
Hi all,
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. 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?
--
Regards,
Libin Varghese.
|
|
From: Nicholas N. <nj...@cs...> - 2006-03-14 22:44:08
|
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 |
|
From: Libin V. <li...@gm...> - 2006-03-15 04:51:32
|
Nicholas Nethercote wrote: > 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). I am interested to find out what that criteria is? How does this hashing algo make a key unique. ~Libin |