On Mon, Mar 11, 2019 at 8:03 PM Tom Lane <t...@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