[PATCH] D115416: [lld-macho] Prevent writing map files on the critical path

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 18:36:19 PST 2021


thevinster added a comment.





================
Comment at: lld/MachO/Writer.cpp:1103-1114
+  ThreadPool writeUuidThreadPool;
+
   ArrayRef<uint8_t> data{buffer->getBufferStart(), buffer->getBufferEnd()};
   unsigned chunkCount = parallel::strategy.compute_thread_count() * 10;
   // Round-up integer division
   size_t chunkSize = (data.size() + chunkCount - 1) / chunkCount;
   std::vector<ArrayRef<uint8_t>> chunks = split(data, chunkSize);
----------------
oontvoo wrote:
> why is this change needed?
> 
This commit is meant as a way to show the different ways we could be using `ThreadPool`. It's more of an RFC (See https://reviews.llvm.org/D115416#3190992). As far as why we want to change it (per @int3's suggestion), we want to change all our uses of `parallelForEach` in favor of `ThreadPool` so we can control the total number of threads. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115416/new/

https://reviews.llvm.org/D115416



More information about the llvm-commits mailing list