Re: Latch implementation that wakes on postmaster death on both win32 and Unix

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Дата
Msg-id CAEYLb_UCWe=yELaeoJ63gG-rdo1Bvd1RM-oe_mbGp0c5Q_cXCA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Latch implementation that wakes on postmaster death on both win32 and Unix  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Список pgsql-hackers
On 8 July 2011 13:40, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> I put the burden on the callers. Removing the return value from WaitLatch()
> altogether just makes life unnecessarily difficult for callers that could
> safely use that information, even if you sometimes get spurious wakeups. In
> particular, the coding in pgarch.c is nicer if you can simply check the
> return code for WL_TIMEOUT, rather than call time(NULL) to figure out if the
> timeout was reached.

+1

> Attached is a new version of this patch. PostmasterIsAlive() now uses read()
> on the pipe instead of kill().

The consensus so far is that in practice spurious wake-ups in
auxiliary process event loops won't a problem. You may want to wait
for others to weigh in here.

This comment in pgarch.c is slightly malformed - note the quote:

/** Sleep until a signal is received, or until a poll is forced by' PGARCH_AUTOWAKE_INTERVAL having passed since
last_copy_time,or* until postmaster dies.*/ 

Other than that, I suggest you commit v8 as-is.

Incidentally, I like that this removes the amDirectChild argument to
PostmasterIsAlive() - an added benefit.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


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

Предыдущее
От: Kohei KaiGai
Дата:
Сообщение: Re: [v9.2] DROP Reworks Part.1 - Consolidate routines to handle DropStmt
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Latch implementation that wakes on postmaster death on both win32 and Unix