Re: pg_usleep for multisecond delays

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: pg_usleep for multisecond delays
Дата
Msg-id 20230210185120.GA810628@nathanxps13
обсуждение исходный текст
Ответ на Re: pg_usleep for multisecond delays  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_usleep for multisecond delays  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Fri, Feb 10, 2023 at 10:18:34AM -0500, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> 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.

That seems workable.  I think it might also need to accept a function
pointer for custom interrupt checking (e.g., archiver code should use
HandlePgArchInterrupts()).  I'll put something together if that sounds
alright.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inconsistent nullingrels due to oversight in deconstruct_distribute_oj_quals
Следующее
От: Jeff Davis
Дата:
Сообщение: Doc fix for CREATE DATABASE