[PATCH] D142318: [Support] Add ThreadPoolAllocator class.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 22 15:12:56 PST 2023


avl created this revision.
avl added reviewers: MaskRay, dblaikie, dexonsmith, steven_wu.
Herald added a project: All.
avl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

ThreadPoolAllocator allows separating allocations by thread id.
That makes allocations race free. It is possible because
ThreadPoolExecutor class creates threads, keeps them until
the destructor of ThreadPoolExecutor is called, and assigns ids
to the threads. Thus ThreadPoolAllocator should be used with only
threads created by ThreadPoolExecutor. The idea of such allocator
was discussed in D133715 <https://reviews.llvm.org/D133715> and D133713 <https://reviews.llvm.org/D133713>

Depends on D142317 <https://reviews.llvm.org/D142317>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142318

Files:
  llvm/include/llvm/Support/ThreadPoolAllocator.h
  llvm/unittests/Support/CMakeLists.txt
  llvm/unittests/Support/ThreadSafeBumpPtrAllocatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142318.491207.patch
Type: text/x-patch
Size: 5713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230122/7fc9f967/attachment.bin>


More information about the llvm-commits mailing list