On Wed Oct 26 15:52:49 2022 +0000, Jinoh Kang wrote:
I noticed the following comment in the latest revision:
/* Ensure writes so far are visible to other threads, so that we can avoid sending a memory barrier APC * from NtFlushProcessWriteBuffers to this thread while it is sleeping. */ MemoryBarrier();
So I'd say this is paired with future `FlushProcessWriteBuffers` requests from other threads while the current thread is sleeping.
Why do we need a general memory barrier in server_select(), though? A memory barrier is part of the FlushProcessWriteBuffers API, but there are other APIs that do server_select().