Skip to main content

Module sync

Module sync 

Source
Expand description

Waiting on a shared 32-bit word, the primitive under every “wake me when this changes” in Orbit: ring readiness, cell changes.

wait_word parks the caller until the word no longer holds expected (or spuriously; callers loop). wake_word wakes every waiter on it. The word may live in shared memory: Linux futex, FreeBSD umtx and macOS os_sync_wait_on_address all key waiters by the physical location, so a wake in one process reaches a waiter in another with nothing carried between them. No descriptor, no channel: the memory is the signal.

macOS needs 14.4 for the shared form; below that wait_word answers ErrorKind::Unsupported and a caller polls instead.

Functions§

wait_word
wake_word