Skip to content

Replace per-iteration std::async with a persistent thread pool#332

Open
saleelk wants to merge 1 commit into
candidatefrom
saleelk/ThreadPoolFix
Open

Replace per-iteration std::async with a persistent thread pool#332
saleelk wants to merge 1 commit into
candidatefrom
saleelk/ThreadPoolFix

Conversation

@saleelk

@saleelk saleelk commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator
  • The executor/transfer dispatch create a fresh std::thread on every
    iteration via std::async, adding thread-creation overhead and jitter to
    the measured host time.
  • Introduce a persistent ThreadPool created once per
    RunTransfers call, with separate executor and transfer pools to avoid a
    nested-blocking deadlock, and a ParallelRun helper that runs unit 0 inline and
    farms the rest to the pool. Reduces executor-time variance on unpinned runs.

Technical Details

Test Plan

Test Result

Submission Checklist

- The executor/transfer dispatch create a fresh std::thread on every
iteration via std::async, adding thread-creation overhead and jitter to
the measured host time.
- Introduce a persistent ThreadPool created once per
RunTransfers call, with separate executor and transfer pools to avoid a
nested-blocking deadlock, and a ParallelRun helper that runs unit 0 inline and
farms the rest to the pool. Reduces executor-time variance on unpinned runs.
@saleelk saleelk requested a review from a team as a code owner July 13, 2026 00:47
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