Re: Restart pg_usleep when interrupted

Поиск
Список
Период
Сортировка
От Sami Imseih
Тема Re: Restart pg_usleep when interrupted
Дата
Msg-id 3712E898-03DA-4E03-AF51-D3E24DE68216@gmail.com
обсуждение исходный текст
Ответ на Re: Restart pg_usleep when interrupted  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Ответы Re: Restart pg_usleep when interrupted
Re: Restart pg_usleep when interrupted
Список pgsql-hackers

I did a few tests with the patch and did not see any "large" drifts like the
ones observed above.

Thanks for testing.

I think it could be "simplified" by making use of instr_time instead of timespec
for current and absolute. Then I think it would be enough to compare their
ticks.

Correct I attached a v2 of this patch that uses instr_time to check the elapsed
time and break out of the loop. It needs some more benchmarking.

Since sub-millisecond sleep times are not guaranteed as suggested by
the vacuum_cost_delay docs ( see below ), an alternative idea
is to use clock_nanosleep for vacuum delay when it’s available, else
fallback to WaitLatch.

Wouldn't that increase even more the cases where sub-millisecond won't be
guaranteed?

Yes, nanosleep is going to provide the most coverage as it’s widely available.

Regards,


Sami

Вложения

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