On Thu, Mar 11, 2021 at 04:37:39PM +1300, Thomas Munro wrote: > Michael, when you said "That's pretty hack-ish, still efficient" in > reference to this code: > >> - if (IsUnderPostmaster && !PostmasterIsAlive()) >> + if (IsUnderPostmaster && >> +#ifndef USE_POSTMASTER_DEATH_SIGNAL >> + count++ % 1024 == 0 && >> +#endif >> + !PostmasterIsAlive()) > > Is that an objection, and do you see a specific better way?
I'd like to believe that there are more elegant ways to write that, but based on the numbers you are giving, there is too much gain here to ignore it. I would avoid 1024 as a hardcoded value though, so you could just stick that in a #define or such. So please feel free to go ahead. Thanks for asking. > I know that someone just needs to write a Windows patch to get us a > postmaster death signal when the postmaster's event fires, and then > the problem will go away on Windows. I still want this change, > because we don't have such a patch yet, and even when someone writes > that, there are still a couple of Unixes that could benefit. Wow. This probably means that we would be able to get rid of USE_POSTMASTER_DEATH_SIGNAL? -- Michael
signature.asc
Description: PGP signature