7 ms·
Windows has an analogue to futexes called WaitOnAddress.[1] Zig's stdlib claims SRW locks are faster than a futex-based implementation.[2] But the futex-based i
by overthrow 3y ago
Windows has an analogue to futexes called WaitOnAddress.[1] Zig's stdlib claims SRW locks are faster than a futex-based implementation.[2] But the futex-based implementation a few lines down that should run fine on Windows since it uses the cross-platform futex abstraction, so it wouldn't be hard to benchmark.
[1]: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress https://learn.microsoft.com/en-us/windows/win32/api/synchapi...
[2]: https://github.com/ziglang/zig/blob/295b8ca467da36cd1066395e7f50b6245f456573/lib/std/Thread/Mutex.zig#L118 https://github.com/ziglang/zig/blob/295b8ca467da36cd1066395e...