Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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:
        user_locks.c (r1.18 -> r1.19)
        vacuum.c (r1.309 -> r1.310)
        README (r1.16 -> r1.17)
        lmgr.c (r1.75 -> r1.76)
        lock.c (r1.154 -> r1.155)
        proc.c (r1.158 -> r1.159)
        lmgr.h (r1.48 -> r1.49)
        lock.h (r1.87 -> r1.88)

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group