Re: Latch implementation that wakes on postmaster death on both win32 and Unix - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Date
Msg-id CAEYLb_UCWe=yELaeoJ63gG-rdo1Bvd1RM-oe_mbGp0c5Q_cXCA@mail.gmail.com
Whole thread Raw
In response to Re: Latch implementation that wakes on postmaster death on both win32 and Unix  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Latch implementation that wakes on postmaster death on both win32 and Unix
List 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 by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [v9.2] DROP Reworks Part.1 - Consolidate routines to handle DropStmt
Next
From: Heikki Linnakangas
Date:
Subject: Re: Latch implementation that wakes on postmaster death on both win32 and Unix