On Thu Aug 31 23:45:02 2023 +0000, Yuxuan Shui wrote:
I reduce the length of sleep in the test and now this MR is ~~faster~~ on par with the current version. So clearly this would be workload dependent.
I believe this MR is slower than current SRWLOCK because the scheduling is different, since now the lock is fairer. From my synthetic randomized test, this MR has lower maximum number of concurrent shared owners. With 24 threads, this MR has ~7 max concurrent owners, vs ~20 currently.
Native SRWLOCK behaves very close to this MR in this regard, but is much much slower in some cases (I've seen up to 15x slower).