Expand description
Guest thread support: host pthread spawn + bsdthread_* helpers.
Model (micro / clean-room):
bsdthread_registerstores the libpthread start trampoline VA.bsdthread_createspawns a host thread that jumps into that trampoline with Darwin_pthread_startregister convention (x0–x3).bsdthread_terminateswitches back to a saved host stack thenpthread_exits this host thread only (never exit on the guest stack).- Guest
pthread_joincompletion (done+ futex wake) is published from the host stack so joiners nevermunmapa stack still in use. - Live spawn requires Linux aarch64 (same as the trap backend).
Structs§
- Guest
Thread Start - Arguments for a newly created guest worker.
Functions§
- alloc_
tid - Allocates a new guest thread id (unique within the process run).
- live_
workers - Number of live worker threads spawned via
bsdthread_create. - reset_
thread_ runtime - Resets thread counters for a new guest run.
- spawn_
guest_ thread - Spawns a host thread that enters guest code at
start.entry. - thread_
selfid - Current host thread’s guest tid (stable for the host thread lifetime).