On Thu Sep 1 15:38:33 2022 +0000, Jinoh Kang wrote:
Do you remember why you added a memory barrier in `server_select`?
It was accidental. That change should be a distinct patch on its own.
Afaict it's not needed
No, it's not needed for this MR. The idea was that `server_select` should act as a strong memory barrier itself, so that the thread calling `FlushProcessWriteBuffers` did not need to call `MemoryBarrier()` explicitly This is based on my reading of https://docs.microsoft.com/en-us/windows/win32/sync/synchronization-and-mult...: it seems to imply that wait functions shall act as barriers themselves. It makes sense since the waiter would expect to read latest values from shared variables when it wakes up.
but I copied it into this mr for now.
Also if you want me to add a Co-Authored-By for you please let me know.
How about splitting the patch instead? The first commit would introduce the fallback path, the second membarrier(), and so on. We're not introducing regression by rolling out an inefficient `FlushProcessWriteBuffers` implementation, since it had never worked in the first place.
done