Re: Listen / Notify - what to do when the queue is full

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joachim Wieland <joe@mcknight.de>, Greg Smith <greg@2ndquadrant.com>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, "Florian G. Pflug" <fgp@phlo.org>, Josh Berkus <josh@agliodbs.com>, pgsql-hackers@postgresql.org
Date: 2010-01-20T00:29:03Z
Lists: pgsql-hackers
On Tue, 2010-01-19 at 19:24 -0500, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > I was also worried about holding multiple LWLocks at once -- is such
> > practice generally avoided in the rest of the code?
> 
> It's allowed but remember that there is no deadlock detection in lwlock.c.
> You must be very certain that there is only one possible order in which
> such locks could be taken.  Interactions with heavyweight locks would be
> bad news as well.

That was my worry initially.

> On the whole it might be better if a heavyweight lock were used,
> such that it'll automatically clean up after commit.  (I'm still
> wondering if we couldn't do without the lock altogether though.)

Yes, I think there's a better way as well. I'll look into it.

Regards,
	Jeff Davis