Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A9A68633CA4 for ; Wed, 20 Jan 2010 16:10:55 -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 91186-09 for ; Wed, 20 Jan 2010 20:10:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (start.fetter.org [66.92.188.65]) by mail.postgresql.org (Postfix) with ESMTP id A369D6333C6 for ; Wed, 20 Jan 2010 16:10:43 -0400 (AST) Received: by fetter.org (Postfix, from userid 500) id F3408FBC4C8; Wed, 20 Jan 2010 12:10:41 -0800 (PST) Date: Wed, 20 Jan 2010 12:10:41 -0800 From: David Fetter To: Heikki Linnakangas Cc: Tom Lane , Andres Freund , Simon Riggs , pgsql-hackers@postgresql.org, Hiroyuki Yamada Subject: Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby) Message-ID: <20100120201041.GC306@fetter.org> 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> <4B575809.7000106@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B575809.7000106@enterprisedb.com> User-Agent: Mutt/1.5.20 (2009-08-17) 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/2008 X-Sequence-Number: 155229 On Wed, Jan 20, 2010 at 09:22:49PM +0200, Heikki Linnakangas wrote: > 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. Is this a TODO yet? Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate