Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-28 Thread Cui Shijun
Ah... It seems that a item is calculated its hash value, get the bucket number from it and insert into that bucket chain. The insertion has nothing to do with partition number(but Alvaro says which hash is used depends on the partition number. I haven't really understood this: how can we get a

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-28 Thread Cui Shijun
2007/4/28, Heikki Linnakangas [EMAIL PROTECTED]: 3. Lock that partition 6. Unlock partition I suddenly realize that LW locks are used to manage the lock hash table.So when a item is to be inserted into hash table, we must gain that partition lock first to change that table. As the insertion

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-28 Thread Heikki Linnakangas
Cui Shijun wrote: As the insertion algorithm described, a specific partition lock manage some items, but these items can be stored in anywhere of the hash table,not necessarily in a bucket chain. So there are some problems with different partitions use different hash chains, a partition can use

Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-27 Thread rancpine cui
-- Forwarded message -- From: rancpine cui [EMAIL PROTECTED] Date: 2007-4-27 下午9:22 Subject: Re: [HACKERS] How does the partitioned lock manager works? To: Heikki Linnakangas [EMAIL PROTECTED] Thanks for your reply. :-) I've seen from the README that The shared-memory hash tables

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-27 Thread Alvaro Herrera
rancpine cui escribió: I've seen from the README that The shared-memory hash tables for LOCKs and PROCLOCKs are organized so that different partitions use different hash chains, and thus there is no conflict in working with objects in different partitions. What does hash chains mean? Each

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-27 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: rancpine cui escribió: What does hash chains mean? Each hash chain is a different, separate, independent hash struct. It's pretty much equivalent to hash bucket --- this comment says chain because it's focusing on the physical representation of the

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-27 Thread rancpine cui
2007/4/27, Alvaro Herrera [EMAIL PROTECTED]: Which hash is used depends on the partition number. So the method of calculating the bucket number can promise that all items in the bucket link list belong to ONE partition?

Re: Fwd: [HACKERS] How does the partitioned lock manager works?

2007-04-27 Thread Tom Lane
rancpine cui [EMAIL PROTECTED] writes: So the method of calculating the bucket number can promise that all items in the bucket link list belong to ONE partition? It's not that hard: the bucket number is some number of low-order bits of the hash value, and the partition number is some smaller