pgsql: Simplify shared-memory lock data structures as per recent

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Simplify shared-memory lock data structures as per recent
Date: 2005-06-14 22:15:33
Message-ID: 20050614221533.1A848528E0@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Simplify shared-memory lock data structures as per recent discussion:
it is sufficient to track whether a backend holds a lock or not, and
store information about transaction vs. session locks only in the
inside-the-backend LocalLockTable. Since there can now be but one
PROCLOCK per lock per backend, LockCountMyLocks() is no longer needed,
thus eliminating some O(N^2) behavior when a backend holds many locks.
Also simplify the LockAcquire/LockRelease API by passing just a
'sessionLock' boolean instead of a transaction ID. The previous API
was designed with the idea that per-transaction lock holding would be
important for subtransactions, but now that we have subtransactions we
know that this is unwanted. While at it, add an 'isTempObject' parameter
to LockAcquire to indicate whether the lock is being taken on a temp
table. This is not used just yet, but will be needed shortly for
two-phase commit.

Modified Files:
--------------
pgsql/contrib/userlock:
user_locks.c (r1.18 -> r1.19)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/userlock/user_locks.c.diff?r1=1.18&r2=1.19)
pgsql/src/backend/commands:
vacuum.c (r1.309 -> r1.310)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c.diff?r1=1.309&r2=1.310)
pgsql/src/backend/storage/lmgr:
README (r1.16 -> r1.17)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/README.diff?r1=1.16&r2=1.17)
lmgr.c (r1.75 -> r1.76)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lmgr.c.diff?r1=1.75&r2=1.76)
lock.c (r1.154 -> r1.155)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c.diff?r1=1.154&r2=1.155)
proc.c (r1.158 -> r1.159)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/proc.c.diff?r1=1.158&r2=1.159)
pgsql/src/include/storage:
lmgr.h (r1.48 -> r1.49)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/lmgr.h.diff?r1=1.48&r2=1.49)
lock.h (r1.87 -> r1.88)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/lock.h.diff?r1=1.87&r2=1.88)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-14 22:15:58 pgsql: Use '  ' escapes for leading spaces in table values, for use
Previous Message Bruce Momjian 2005-06-14 21:04:42 pgsql: Add pg_postmaster_start_time() function.