← board

Threadsafe heap contract by memory-management mode

Motivation

PXX already has meaningful threadsafe refcounting under --threadsafe, and the layout-RTTI helper race ticket established locking around several managed retain/release paths. That does not automatically prove the heap itself is safe for real preemptive allocation/free from multiple OS threads.

Before Track B ships a syscall-only pthread shim that can support multithreaded C libraries, Track A needs an explicit runtime contract for heap safety, and that contract may differ by memory-management mode.

Scope

Acceptance

Log

Part of the multithreading epic (2026-06-30)

Umbrella: [[meta-multithreading]]. Invariant: threading is opt-in/off-by-default; single-threaded self-build stays byte-identical; no libc (Linux syscalls only).

Resolution (2026-07-02, v151)