[PATCH] D123225: [ThreadPool] add ability to group tasks into separate groups

Luboš Luňák via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 08:29:13 PDT 2022


llunak created this revision.
llunak added a reviewer: chandlerc.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: All.
llunak requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is needed for parallelizing of loading modules symbols in LLDB (D122975 <https://reviews.llvm.org/D122975>). Currently LLDB can parallelize indexing symbols when loading a module, but modules are loaded sequentially. If LLDB index cache is enabled, this means that the cache loading is not parallelized, even though it could. However doing that creates a threadpool-within-threadpool situation, so the number of threads would not be properly limited.

This change adds ThreadPool::TaskGroup as a tag type that can be used with ThreadPool calls to put tasks into groups that can be independently waited for (even recursively from within a task) but still run in the same thread pool.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123225

Files:
  llvm/include/llvm/Support/ThreadPool.h
  llvm/lib/Support/ThreadPool.cpp
  llvm/tools/llvm-profdata/llvm-profdata.cpp
  llvm/unittests/Support/ThreadPool.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123225.420882.patch
Type: text/x-patch
Size: 18613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220406/e9e13e7b/attachment.bin>


More information about the llvm-commits mailing list