threadpool: add SubmitMany #34576

pull andrewtoth wants to merge 1 commits into bitcoin:master from andrewtoth:threadpool_submitmany changing 2 files +73 −2
  1. andrewtoth commented at 5:39 pm on February 12, 2026: contributor

    The current ThreadPool::Submit is not very efficient when we have a use case where we need to submit multiple tasks immediately. The Submit method must take the lock for each task, and notifies only a single worker thread. This will cause lock contention with the awakened worker thread trying to take the lock and the caller trying to submit the next task.

    Introduce SubmitMany, which takes the lock once and submits a vector of tasks, then notifies all worker threads after the lock is released.

    This is needed for #31132 to be able to use ThreadPool.

  2. threadpool: add SubmitMany af1196686f
  3. DrahtBot commented at 5:40 pm on February 12, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK furszy

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  4. furszy commented at 8:16 pm on February 12, 2026: member
    Concept ACK

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-17 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me