Skip to content

00000: Wake reserved thread pool workers, PATCH - #649

Closed
howso-mario wants to merge 1 commit into
mainfrom
00000-fix-thread-pool-reserved-wakeup
Closed

howso-mario wants to merge 1 commit into
mainfrom
00000-fix-thread-pool-reserved-wakeup

Conversation

@howso-mario

Copy link
Copy Markdown
Contributor

Summary

  • wake waitForActivate when ChangeCurrentThreadStateFromActiveToWaiting() requests one reserved worker to reactivate
  • add deterministic CTest coverage for repeated reserve/reactivation, resize/rebuild, and shutdown states
  • keep the fix separate from PR 26028: Reduces threadpool overhead #648, which merged as 144d6714c8bf8d9a4736b386b3df2696c92be404

Root cause

Reserved workers wait on waitForActivate with the predicate numThreadsToTransitionToReserved < 0. The active-to-waiting transition decremented that counter when a reserved worker was available, but notified only waitForTask. The predicate became true without waking the condition variable that owns it.

The mismatch existed at both PR #648's base a2d4ea98e88224827a753024ba414a1c836380fe and exact head da4c8500d3693ac7a7d9c9941d69a006a386aca3. After #648 merged, it remained present at merge SHA 144d6714c8bf8d9a4736b386b3df2696c92be404.

Verification

  • post-26028: Reduces threadpool overhead #648 pre-fix proof, Debug and Release: reserve_reactivation and resize failed 5/5 with reserved worker was not reactivated; shutdown passed 5/5
  • fixed focused CTest, Debug and Release: 3/3 passed in each configuration
  • fixed repetition: 3,000/3,000 executions passed in Debug and 3,000/3,000 in Release
  • GCC 14 ASan+UBSan: reserve/reactivation, resize, shutdown all passed
  • native amd64-release-linux: 475/475 build steps and 31/31 CTests passed
  • independent Claude Code review: APPROVE, no blockers
  • git diff --check: passed

The Docker-backed worker could not access the host Docker daemon, so the exact CI container images were not run locally; GitHub CI is the authoritative cross-platform/container gate.

@howso-mario
howso-mario requested review from a team as code owners September 22, 2026 16:32
@howsohazard

Copy link
Copy Markdown
Contributor

Too much test overhead

@howso-mario

Copy link
Copy Markdown
Contributor Author

ADDRESSED: @howsohazard — removed the standalone thread-pool test executable, CTest registrations, and 153-line test harness that added the reported test overhead. The PR diff is now only the two-line reserved-worker wakeup fix. Canonical amd64-release-linux configure/build/test passed 28/28 tests. Commit 5346e30.

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.

2 participants