diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-11 21:02:18 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-11 21:02:18 +0000 |
commit | ec0baf949ecdee0bf8d8e60cc8dba0137aac8d19 (patch) | |
tree | b435a97a4e87c31a6b644ac2d9d1f433de487588 /src/backend/access/transam | |
parent | be8100d64ec93ccd8160b37379ba189aab4d0ef1 (diff) | |
download | postgresql-ec0baf949ecdee0bf8d8e60cc8dba0137aac8d19.tar.gz postgresql-ec0baf949ecdee0bf8d8e60cc8dba0137aac8d19.zip |
Divide the lock manager's shared state into 'partitions', so as to
reduce contention for the former single LockMgrLock. Per my recent
proposal. I set it up for 16 partitions, but on a pgbench test this
gives only a marginal further improvement over 4 partitions --- we need
to test more scenarios to choose the number of partitions.
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r-- | src/backend/access/transam/twophase.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index ffdee8388b3..0898df62337 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.17 2005/11/22 18:17:07 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.18 2005/12/11 21:02:17 tgl Exp $ * * NOTES * Each global transaction is associated with a global transaction @@ -284,7 +284,8 @@ MarkAsPreparing(TransactionId xid, const char *gid, gxact->proc.lwWaitLink = NULL; gxact->proc.waitLock = NULL; gxact->proc.waitProcLock = NULL; - SHMQueueInit(&(gxact->proc.procLocks)); + for (i = 0; i < NUM_LOCK_PARTITIONS; i++) + SHMQueueInit(&(gxact->proc.myProcLocks[i])); /* subxid data must be filled later by GXactLoadSubxactData */ gxact->proc.subxids.overflowed = false; gxact->proc.subxids.nxids = 0; |