On Fri Sep 22 18:36:54 2023 +0000, Yuxuan Shui wrote:
Probably won't help in terms of latency, but should reduce busy waiting I believe?
It just feels very weird to me that we're explicitly bypassing win32 futexes for the normal path but still using them for the spinlock. I can only imagine native doesn't do that, but Microsoft must have discovered some undiscoverable magic algorithm anyway...
Perhaps more saliently, win32 futexes use a spinlock internally. That leads me to think that, firstly, using a win32 futex may not actually help here since it'll still hit *that* spinlock, and secondly, if win32 futexes use a spinlock and are performant enough already [1] then taking the spinlock here won't actually have adverse effects.
[1] Well, except for bug 54979. But bug 54979 is only a problem because many different futexes hash to the same waitqueue, and that doesn't scale. That's not a problem for SRW locks since they each have their own waitqueue.