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

From Tom Lane
Subject Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date
Msg-id 17017.1282314484@sss.pgh.pa.us
Whole thread Raw
In response to Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
List pgsql-hackers
[ It's way past time to change the thread title ]

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 20/08/10 16:24, Tom Lane wrote:
>> You keep on proposing solutions that only work for walsender :-(.

> Well yes, the other places where we use pg_usleep() are not really a 
> problem as is.

Well, yes they are.  They cause unnecessary process wakeups and thereby
consume cycles even when the database is idle.  See for example a
longstanding complaint here:
https://bugzilla.redhat.com/show_bug.cgi?id=252129

If we're going to go to the trouble of having a mechanism like this,
I'd like it to fix that problem so I can close out that bug.

> There's semtimedop(). I don't know how portable it is, but it seems to 
> exist at least on Linux, Solaris, HPUX and AIX.

It's not on my HPUX, and I don't see it in the Single Unix Spec.

> On what platforms do we use sysv semaphores?

AFAIK, everything except Windows and extremely old versions of OS X.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: small smgrcreate cleanup patch
Next
From: "Kevin Grittner"
Date:
Subject: Re: Deadlock bug