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

LWLockRelease

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: LWLockRelease
Date: 2005-02-03 06:10:41
Message-ID: KGEFLMPJFBNNLNOOOPLGCEDECIAA.simon@2ndquadrant.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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.

Any thoughts on reducing the size of that array and/or reducing the lock
release time?

Best Regards, Simon Riggs


Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-02-03 06:32:03
Subject: Re: Crash when inserting gist records, or creating index on ( int, geom )
Previous:From: Tom LaneDate: 2005-02-03 05:17:19
Subject: Re: subselects in the target list

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