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_V2h6N0wO7-nizgT7WWdNH28rEZVzfxsf_yrfyqfmQjdg@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 5 July 2011 07:49, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > Good point, and testing shows that that is exactly what happens at least on > Linux (see attached test program). So, as the code stands, the children will > go into a busy loop until the grandparent calls waitpid(). That's not good. > > In that light, I agree we should replace kill() in PostmasterIsAlive() with > read() on the pipe. It would react faster than the kill()-based test, which > seems like a good thing. Or perhaps do both, and return false if either test > says the postmaster is dead. Hmm. Why assume that the opposite problem doesn't exist? What if the kill-based test is faster than the read() on the pipe on some platform or under some confluence of events? I suggest that we agree on a standard for determining whether or not the postmaster is dead and stick to it - that's already the case on Windows. Since that standard cannot be the kill() based test, because that would make a postmaster death aware latch implementation impossible, it has to be the read() test proposed by Florian. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services
В списке pgsql-hackers по дате отправления: