Skip to content

fix(executor): make wait a completion barrier - #148

Open
LimiNode wants to merge 4 commits into
mainfrom
fix/task-executor-wait-regression
Open

LimiNode wants to merge 4 commits into
mainfrom
fix/task-executor-wait-regression

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • close the MPSC TaskExecutor::wait() race with completion tickets reserved before publication
  • make resize idle detection use the same completion protocol
  • add blocked-task, nested-submission, and repeated MPSC producer regression coverage
  • document the completion barrier contract

Validation

  • Windows MSVC MPSC build: 61/61 tests passed
  • focused wait-barrier test: passed with MPSC and non-MPSC configurations
  • focused wait-barrier test repeated five times

This is intentionally separate from the merged gzip/benchmark PR #147.

Track MPSC submissions before publication and complete each ticket when the task runs or is rejected. Make wait and resize drain against the completion protocol, and add blocked-task, nested-submission, and stress regressions for the documented wait contract.
Use atomic submission and completion counters so the MPSC producer path does not acquire a new mutex. Keep the wait condition variable only for blocking callers while preserving the completion barrier.
Update the completion state while holding the wait mutex before notifying condition-variable waiters. This prevents a lost wake-up while keeping the MPSC submission path free of locks.
Give the TaskExecutor wait regression a bounded CTest timeout so a future completion protocol regression fails the suite instead of hanging CI indefinitely.

This branch has not been deployed

No deployments
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