mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
2bc89a5198
And therefore no longer depend on a mutex API. The idea here is to rely on cache line operations being very fast. Buckets span exactly one cache line each, storing only waiter pointers. Additions and removals do linear weak cmpxchg scan over the cache line, repeating until sucess. If there are more parked threads with bucket hash collisions than fits into a cache line then wait() degrades into a spin lock.