Re: pg_usleep for multisecond delays - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_usleep for multisecond delays
Date
Msg-id 4077536.1676042314@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_usleep for multisecond delays  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_usleep for multisecond delays
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I somehow feel that we should be trying to get rid of cases where
> WaitLatch is not desired.

+1

> I wonder if we should have a wrapper around WaitLatch() that documents
> that if the latch is set before the time expires, it will reset the
> latch and try again to wait for the remaining time, after checking for
> interrupts etc.

Resetting the latch seems not very friendly for general-purpose use
... although I guess we could set it again on the way out.

BTW, we have an existing pg_sleep() function that deals with all
of this except re-setting the latch.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_usleep for multisecond delays
Next
From: Andrew Dunstan
Date:
Subject: Re: run pgindent on a regular basis / scripted manner