Skip to content

all: add wait_parked, rename wait_blocked to wait_registered and bump to v0.4.0 - #11

Merged
karalabe merged 1 commit into
dark-bio:mainfrom
karalabe:wait-parked
Oct 5, 2026
Merged

karalabe merged 1 commit into
dark-bio:mainfrom
karalabe:wait-parked

Conversation

@karalabe

@karalabe karalabe commented Oct 5, 2026

Copy link
Copy Markdown
Member

Adds TestClock::wait_parked, a barrier that waits until workers are actually parked, and renames wait_blocked to wait_registered without changing what it does.

wait_blocked counted a wait from its start until it returned. That includes the stretch after a notification or an advance has woken it but before its thread runs. A test that used it as a settling barrier could therefore move on while a woken worker was still pending, and read that worker's stale deadline. wire-rs's connection harness did exactly that, and a scheduled fuzz run caught it.

  • wait_registered(n) is the old wait_blocked, under a name that says what it counts. Its behaviour stays the same, and so do next_deadline and its clamp to the current time.
  • wait_parked(n) returns once at least n registered waits have their deadlines unreached or absent, and no notification on the clock is outstanding. A notification stays outstanding until every wait it ended has returned. Each signal publishes its outstanding notifications to a single counter on the clock, at constant cost per change.
  • "Parked" now means only that strong state, throughout the README and the docs.

New tests hold woken workers through the crate's own hooks. They check that wait_parked waits where wait_registered does not: after a reached deadline, during an outstanding broadcast, for a pending notify_one credit, and for a notification on another condvar. One more drives a worker through the public Condvar::wait_deadline that picks a new deadline after a notification. Two new loom models cover the notified and the reached cases.

The rename breaks the API, so the version moves to 0.4.0. wire-rs, the CLI and the firmware tests need the rename. wire-rs also moves its settling barriers to wait_parked in a follow-up.

… to v0.4.0

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Astra <noreply@openai.com>
@karalabe
karalabe merged commit 3bbc77b into dark-bio:main Oct 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant