Skip to content

v2026.5.14: std.sync hardening

The std.sync hardening sprint established the current Janus-native synchronization floor:

  • typed Atomic[T] wrapper over SPEC-059 intrinsics
  • Linux futex-backed Parker
  • guard-based Mutex[T]
  • bounded SPSC Chan[T]
  • actor-shaped Mailbox[Msg]
  • one-shot CancelToken
  • timed and cancellable receive helpers
  • SpinLock / SpinMutex dogfooding Atomic[u32]

The compatibility pthread primitives remain in std.sync.mod.

Use leaf modules directly:

use std.sync.atomics.mod as atomics
use std.sync.parker as parker
use std.sync.mutex as mtx
use std.sync.chan as chan
use std.sync.mailbox as mb
use std.sync.cancel as cancel

Leaf re-exports from std.sync.mod are deferred until the cross-module Atomic[T] layout gap is fixed.

The sprint is covered by focused gates:

Terminal window
./scripts/zb test-atomic-e2e
./scripts/zb test-atomic-eligible
./scripts/zb test-parker-roundtrip
./scripts/zb test-mutex-smoke
./scripts/zb test-chan-smoke
./scripts/zb test-cancel-timeout-smoke
./scripts/zb test-spinlock-smoke
./scripts/zb test-spinmutex-smoke
  • Chan[T] and Mailbox[Msg] are SPSC.
  • Multi-thread proof coverage is still in progress.
  • Atomic[bool] and Mutex[bool] wait on the i1 atomic verifier gap.
  • NexusOS parker backend and source-level target dispatch remain future work.