mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01:00
This is achieved by bumping `end_index` by a large enough amount so that a suitably aligned region of memory can always be provided. The potential wasted space this creates is then recovered by a single cmpxchg. This is always successful for single-threaded arenas which means that this version still behaves exactly the same as the old single-threaded implementation when only being accessed by one thread at a time. It can however fail when another thread bumps `end_index` in the meantime. The observerd failure rates under extreme load are: 2 Threads: 4-5% 3 Threads: 13-15% 4 Threads: 15-17% 5 Threads: 17-18% 6 Threads: 19-20% 7 Threads: 18-21% This version offers ~25% faster performance under extreme load from 7 threads, with diminishing speedups for less threads. The performance for 1 and 2 threads is nearly identical. |
||
|---|---|---|
| .. | ||
| build-web | ||
| c | ||
| compiler | ||
| compiler_rt | ||
| docs | ||
| include | ||
| init | ||
| libc | ||
| libcxx | ||
| libcxxabi | ||
| libtsan | ||
| libunwind | ||
| std | ||
| c.zig | ||
| compiler_rt.zig | ||
| fuzzer.zig | ||
| ubsan_rt.zig | ||
| zig.h | ||