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

Re: LWLockRelease

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: LWLockRelease
Date: 2005-02-03 14:32:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
> A few thoughts on LWLock data structures...

> In lwlock.c we hold a list of lwlocks held:
> held_lwlocks[MAX_SIMUL_LWLOCKS]
> where
> #define MAX_SIMUL_LWLOCKS	100

> The code for LWLockRelease assumes that the last acquired lock will
> always be the first one to be released, and uses an O(N) loop to search
> for the lock to release.

> Setting MAX_SIMUL_LWLOCKS to this fairly high number doesn't seem to
> match the optimistic use of the O(N) algorithm.

So?  The search only examines the actually-in-use array entries.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-02-03 14:42:18
Subject: Re: libpq API incompatibility between 7.4 and 8.0
Previous:From: Tom LaneDate: 2005-02-03 14:31:24
Subject: Re: LWLock cache line alignment

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