zig/lib
Matthew Lugg aebd84b525 build runner: refactor step evaluation logic
The previous logic was made really messy by the fact that upon entry to
the step eval worker, the step may not be ready to run, we may be racing
with other workers doing the same check, and we had already acquired our
RSS requirement even though we might not run. It also required iterating
all dependencies each time we were called to check whether we were even
ready to run yet.

A much better strategy is for each step to have an atomic counter
representing how many of its dependencies are yet to complete. When a
step completes (successfully or otherwise), it decrements this value for
all of its dependants, and if it drops any to 0, it schedules that step
to run. This means each step is scheduled exactly once, and only when
all of its dependencies have finished, reducing redundant checks and
hence contention. If the step being scheduled needs to claim RSS which
isn't available, then it is instead added to `memory_blocked_steps`,
which is iterated by the step worker after a step with an RSS claim
finishes.

This logic is more concise than before, simpler to understand, generally
more efficient, and fixes a bug in the RSS tracking. Also, as a nice
side effect, it should also play a little bit nicer with `Io.Threaded`'s
scheduling strategy, because we no longer spawn extremely short-lived
tasks all the time as we previously did.

Resolves: https://codeberg.org/ziglang/zig/issues/30742
2026-01-09 03:16:39 +01:00
..
build-web all: replace all @Type usages 2025-11-22 22:42:38 +00:00
c feat(libzigc): add nan, nanf, nanl and bsearch 2026-01-09 00:26:20 +01:00
compiler build runner: refactor step evaluation logic 2026-01-09 03:16:39 +01:00
compiler_rt compiler-rt: fix f80 ceil/floor optimization 2026-01-08 00:45:52 +01:00
docs std: Remove a handful of things deprecated during the 0.15 release cycle 2025-11-27 20:17:04 +00:00
include remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
init update init template for new main API 2026-01-04 00:27:09 -08:00
libc feat(libzigc): add nan, nanf, nanl and bsearch 2026-01-09 00:26:20 +01:00
libcxx libcxx: use compiler's _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION when set 2025-11-14 02:02:59 +01:00
libcxxabi remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libtsan remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libunwind remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
std build runner: refactor step evaluation logic 2026-01-09 03:16:39 +01:00
c.zig libc: use zig isnan and derivates for mingw 2025-08-27 03:58:32 +02:00
compiler_rt.zig compiler-rt: fix f80 ceil/floor optimization 2026-01-08 00:45:52 +01:00
fuzzer.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
ubsan_rt.zig Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
zig.h zig.h: drop dependency on deleted compiler_rt functions 2025-11-12 16:00:16 +00:00