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.
A simpler solution on Windows might be to make the timeout on auxiliary processes much smaller, but have it increase on each subsequent timeout (starting from scratch if we wakeup for any reason other than timeout) until eventually it maxes out at something like the current value for PGARCH_AUTOWAKE_INTERVAL. If backends are sleeping for increasing periods of time, the chance of the postmaster crashing goes down, so denial of service is much less of a concern. An alternative might be to just not do this on Windows. Certainly, idle wakeups are likely to be less important on that platform, which is not a very popular choice for virtual machines deployed on cloudy infrastructure, the use case that will benefit from these enhancements the most, by some margin. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers