Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Markus Wanner <markus(at)bluegap(dot)ch>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date: 2010-09-09 05:32:39
Message-ID: 4C887177.807@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/09/10 23:07, Martijn van Oosterhout wrote:
> On Mon, Sep 06, 2010 at 07:24:59PM +0200, Markus Wanner wrote:
>> Do I understand correctly that the purpose of this patch is to work
>> around the brokenness of select() on very few platforms? Or is there any
>> additional feature that plain signals don't give us?
>
> If the issue is just that select() doesn't get interrupted and we don't
> care about a couple of syscalls, would it not be better to simply use
> sigaction to turn on SA_RESTART just prior to the select() and turn it
> off just after. Or are these systems so broken that select() won't be
> interrupted, even if the signal handler is explicitly configured to do
> so?

I don't know if SA_RESTART is portable. But in any case, that will do
nothing about the race condition where the signal arrives just *before*
the select() call.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-09-09 07:12:47 Re: returning multiple result sets from a stored procedure
Previous Message John Adams 2010-09-08 23:44:07 Re: returning multiple result sets from a stored procedure