On Thu Aug 31 21:35:54 2023 +0000, Yuxuan Shui wrote:
So it's only unfair for a very specific test. It's a simple test where I just have threads constantly acquiring and releasing exclusive SRWLOCKs in s loop. What I observed is threads can loop back and immediately re-acquire the lock after releasing it, causing one thread at a time to dominate the lock. This cannot happen with this MR. But if I make the change to allow it, this MR would get a lot faster.
With a test that randomly acquires lock exclusively/shared then sleeps a while with the lock held, this MR (and the current version) is actually much faster than native. I think I am satisfied.
This MR is slower than the current version though, I'll try with a real game and see how big the impact is.