Re: Process wakeups when idle and power consumption - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Process wakeups when idle and power consumption
Date
Msg-id 4DC7BFAB.3050807@enterprisedb.com
Whole thread Raw
In response to Re: Process wakeups when idle and power consumption  (Peter Geoghegan <peter@2ndquadrant.com>)
Responses Re: Process wakeups when idle and power consumption  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: Process wakeups when idle and power consumption  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-hackers
On 09.05.2011 12:20, Peter Geoghegan wrote:
> I've taken a look into it, and I'm not optimistic about the likelihood
> of the way I've suggested that we can register a callback on process
> termination on windows being acceptable. It seems to be a kludge too
> far. It does work on Vista, just not very well. There is a
> considerable delay on closing the above console application that uses
> this technique, for example, and there seems to be an unpredictable
> delay in the callback occurring.

Can't we use the pipe trick on Windows? The API is different, but we use 
pipes on Windows for other things already. When a process is launched, 
open a pipe between postmaster and the child process. In the child, 
spawn a thread that just calls ReadFile() on the pipe, which blocks. If 
postmaster dies, the ReadFile() call will return with an error.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Yves Weißig
Date:
Subject: Re: could not write block & xlog flush request 3FD/0 is not satisfied
Next
From: Gabriele Bartolini
Date:
Subject: Re: Proposed patch: Smooth replication during VACUUM FULL