Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2010-08-20T14:28:04Z
Lists: 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