Re: Use nanosleep(2) in pg_usleep, if available? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Use nanosleep(2) in pg_usleep, if available?
Date
Msg-id CA+TgmobkuSFwu9yvL5UxPrY-4OgFc5--p0os=qy8BHmfjGPWGg@mail.gmail.com
Whole thread Raw
In response to Use nanosleep(2) in pg_usleep, if available?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Use nanosleep(2) in pg_usleep, if available?
List pgsql-hackers
On Mon, Mar 11, 2019 at 8:03 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> While the WaitLatch alternative avoids the problem, I doubt
> we're ever going to remove pg_usleep entirely, so it'd be
> good if it had fewer sharp edges.  nanosleep() has the
> same behavior as Windows, ie, the sleep is guaranteed to be
> terminated by a signal.  So if we used nanosleep() where available
> we'd have that behavior on just about every interesting platform.

Is there any feasible way to go the other way, and make pg_usleep()
actually always sleep for the requested time, rather than terminating
early?

(Probably not, but I'm just asking.)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why don't we have a small reserved OID range for patch revisions?
Next
From: Robert Haas
Date:
Subject: Re: Timeout parameters