ReviewOS

also looking at this

zig-utils/zig-gc

[codex] Fix parallel mark claiming

#1
Merged chris wants to merge codex/parallel-mark-claim into main
1 file +19 -6
8 days ago

Summary

  • Use the atomic mark-claim path for all parallel heaps, not only concurrently marking heaps.
  • Document why the parallel whitening pass stores to mark bits atomically: a lagging peer from the previous mark window can still reach claimMark without holding alloc_lock.

Why

The zig-js no-GIL/TSan verification found a race between parallel whitening and a peer claimMark from the previous mark window. The fix keeps that byte atomic on both sides in parallel heaps.

Validation

zig build test
zig build test -Dtsan=true

Also validated from zig-js during the issue #1 threading roadmap pass:

zig build test
zig build threads-test
zig build test -Dtsan=true
zig build test -Dtsan=true -Dtest-filter=parallel_js
zig build threadfuzz -Dfuzz-verify=true -Dfuzz-iters=300

1 changed file on the files tab, with 0 review threads.

Sign in to comment on this pull request.