Re:The case of the critical section that let multiple thread...
by Wumpnot on Sunday March 23, 2025 @08:47AM
(#43452536)
SRWLock perf is slightly better than Window WaitOnAddress stuff, and works on older versions of windows.
[ Parent
| on HN ]
Re:The case of the critical section that let multiple thread...
by tialaramex on Sunday March 23, 2025 @10:31AM
(#43453186)
I find this unlikely. Do have some real world evidence for this? Microbenchmarks are not at all useful for this stuff in my experience. For speed: In the uncontended case, which is what we mostly care about because if you're contended it's game over for speed, they're both a single atomic CAS, so that's no difference.
In terms of size, the pointer is bigger than you'd want - it's no pthread_mutex or the analogous Windows data structure where it's a multi cache line disaster of a data structure - but it's clearly worse than a futex or WaitOnAddress solution.
Re:The case of the critical section that let multiple thread...
by Wumpnot on Sunday March 23, 2025 @10:35AM
(#43453208)
A few years ago I compared them, it was not a microbenchmark, but a real application. There were a few million(almost entirely uncontended) exclusive locks being taken on startup, SRWLock was consistently faster, though the difference was not large.
Re:The case of the critical section that let multiple thread...
by tialaramex on Sunday March 23, 2025 @10:45AM
(#43453255)
Thanks, I wonder what that's all about.