Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 23A0B632F0D for ; Wed, 20 Jan 2010 15:23:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84171-08 for ; Wed, 20 Jan 2010 19:22:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og113.obsmtp.com (exprod7og113.obsmtp.com [64.18.2.179]) by mail.postgresql.org (Postfix) with SMTP id 900A16326B5 for ; Wed, 20 Jan 2010 15:22:56 -0400 (AST) Received: from source ([74.125.78.27]) by exprod7ob113.postini.com ([64.18.6.12]) with SMTP ID DSNKS1dYD/NoYivdL6TjEVM7iyOgF3rpBBeg@postini.com; Wed, 20 Jan 2010 11:22:56 PST Received: by ey-out-2122.google.com with SMTP id 22so1004882eye.55 for ; Wed, 20 Jan 2010 11:22:54 -0800 (PST) Received: by 10.213.97.4 with SMTP id j4mr1314872ebn.9.1264015373847; Wed, 20 Jan 2010 11:22:53 -0800 (PST) Received: from ?192.168.1.117? ([88.195.103.165]) by mx.google.com with ESMTPS id 24sm291038eyx.14.2010.01.20.11.22.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Jan 2010 11:22:52 -0800 (PST) Message-ID: <4B575809.7000106@enterprisedb.com> Date: Wed, 20 Jan 2010 21:22:49 +0200 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Tom Lane CC: Andres Freund , Simon Riggs , pgsql-hackers@postgresql.org, Hiroyuki Yamada Subject: Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby) References: <200912151111.AA00168@silver.kokolink.net> <201001201740.22069.andres@anarazel.de> <14578.1264006776@sss.pgh.pa.us> <201001201841.15760.andres@anarazel.de> <4B5744C1.40806@enterprisedb.com> <16135.1264011365@sss.pgh.pa.us> <4B57501F.8030804@enterprisedb.com> <17505.1264014420@sss.pgh.pa.us> In-Reply-To: <17505.1264014420@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/2004 X-Sequence-Number: 155225 Tom Lane wrote: > Heikki Linnakangas writes: >> My point is that we should replace such polling loops with something >> non-polling, using wait/signal or semaphores or something. That gets >> quite a bit more complex. You'd probably still have the loop, but >> instead of pg_usleep() you'd call some new primitive function that waits >> until the shared variable changes. > > Maybe someday --- it's certainly not something we need to mess with for > 8.5. As Simon comments, getting it to work nicely in the face of corner > cases (like processes dying unexpectedly) could be a lot of work. Agreed, polling is good enough for 8.5. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com