Repository navigation
all: add wait_parked, rename wait_blocked to wait_registered and bump to v0.4.0 - #11
Merged
Merged
Conversation
… to v0.4.0 Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Astra <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
TestClock::wait_parked, a barrier that waits until workers are actually parked, and renameswait_blockedtowait_registeredwithout changing what it does.wait_blockedcounted 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 oldwait_blocked, under a name that says what it counts. Its behaviour stays the same, and so donext_deadlineand its clamp to the current time.wait_parked(n)returns once at leastnregistered 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.New tests hold woken workers through the crate's own hooks. They check that
wait_parkedwaits wherewait_registereddoes not: after a reached deadline, during an outstanding broadcast, for a pendingnotify_onecredit, and for a notification on another condvar. One more drives a worker through the publicCondvar::wait_deadlinethat 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_parkedin a follow-up.