Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EEB602E0030 for ; Tue, 26 Feb 2008 18:50:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 11356-01 for ; Tue, 26 Feb 2008 18:50:35 -0400 (AST) X-Greylist: delayed 00:38:02.893813 by SQLgrey-1.7.5 Received: from pih-relay06.plus.net (pih-relay06.plus.net [212.159.14.133]) by postgresql.org (Postfix) with ESMTP id 1339C2E0071 for ; Tue, 26 Feb 2008 18:50:41 -0400 (AST) Received: from [80.229.150.39] (helo=mansionfamily.plus.com) by pih-relay06.plus.net with esmtp (Exim) id 1JU82N-0002QZ-ND for pgsql-performance@postgresql.org; Tue, 26 Feb 2008 22:12:36 +0000 Received: from [192.168.0.87] ([192.168.0.87]:1316) by mansionfamily.plus.com with [XMail 1.22 ESMTP Server] id for from ; Tue, 26 Feb 2008 22:16:44 -0000 Message-ID: <47C48F9E.7000505@mansionfamily.plus.com> Date: Tue, 26 Feb 2008 22:15:58 +0000 From: James Mansion Organization: MsgWare User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Tom Lane CC: Joel Stevenson , pgsql-performance@postgresql.org Subject: Re: LISTEN / NOTIFY performance in 8.3 References: <5576.1203795335@sss.pgh.pa.us> <6730.1203829093@sss.pgh.pa.us> <5080.1204047806@sss.pgh.pa.us> In-Reply-To: <5080.1204047806@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 0203fbe2ccf3e0436ac374cc22fc7471 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/358 X-Sequence-Number: 28900 Tom Lane wrote: > read-modify-write type of operation it uses an exclusive lock, so only > one can clear its pg_listener entry at a time. The 'waiting' ones you > are seeing are stacked up behind whichever one has the lock at the > moment. They shouldn't be waiting for long. > I certainly hadn't expected that to be the implementation technique - isn't it smply that we need a sngle flag per worker process and can set/test-and-clear with atomic operations and then a signal to wake them up? Anyway - how hard would it be to install triggers on commit and rollback? Then we could write our own mechanisms. James