Re: WaitLatchOrSocket seems to not count to 4 right...

2022-08-02 Thread Jacob Champion
This entry has been waiting on author input for a while (our current threshold is roughly two weeks), so I've marked it Returned with Feedback. Once you think the patchset is ready for review again, you (or any interested party) can resurrect the patch entry by visiting https://commitfest.pos

Re: WaitLatchOrSocket seems to not count to 4 right...

2022-03-21 Thread Andres Freund
Hi, On 2022-02-11 10:47:45 +1300, Thomas Munro wrote: > I'd originally sketched this out for another project, but I don't > think I need it for that anymore. After this exchange I couldn't > resist fleshing it out for a commitfest, just on useability grounds. > Thoughts? This currently doesn't a

Re: WaitLatchOrSocket seems to not count to 4 right...

2022-02-10 Thread Thomas Munro
On Tue, Feb 8, 2022 at 1:51 PM Thomas Munro wrote: > (and one day we should make it dynamic and change udata to hold > an index instead of a pointer...) Here's a patch like that. I'd originally sketched this out for another project, but I don't think I need it for that anymore. After this excha

Re: WaitLatchOrSocket seems to not count to 4 right...

2022-02-07 Thread Fujii Masao
On 2022/02/08 9:51, Thomas Munro wrote: an index instead of a pointer...) or, since it's a bit silly to add both of those events, maybe we should do: - if ((wakeEvents & WL_POSTMASTER_DEATH) && IsUnderPostmaster) - AddWaitEventToSet(set, WL_POSTMASTER_DEATH, PGINVALID_SOCK

Re: WaitLatchOrSocket seems to not count to 4 right...

2022-02-07 Thread Thomas Munro
On Tue, Feb 8, 2022 at 1:48 PM Fujii Masao wrote: > On 2022/02/08 7:00, Greg Stark wrote: > > Unless I'm misreading this code I think the nevents in > > WaitLatchOrSocket should really be 4 not 3. At least there are 4 calls > > to AddWaitEventToSet in it and I think it's possible to trigger all 4.

Re: WaitLatchOrSocket seems to not count to 4 right...

2022-02-07 Thread Fujii Masao
On 2022/02/08 7:00, Greg Stark wrote: Unless I'm misreading this code I think the nevents in WaitLatchOrSocket should really be 4 not 3. At least there are 4 calls to AddWaitEventToSet in it and I think it's possible to trigger all 4. Good catch! I think you're right. As the quick test, I c

WaitLatchOrSocket seems to not count to 4 right...

2022-02-07 Thread Greg Stark
Unless I'm misreading this code I think the nevents in WaitLatchOrSocket should really be 4 not 3. At least there are 4 calls to AddWaitEventToSet in it and I think it's possible to trigger all 4. I guess it's based on knowing that nobody would actually set WL_EXIT_ON_PM_DEATH and WL_POSTMASTER_DE