[PATCH] D68820: win: Move Parallel.h off concrt to cross-platform code

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 12:31:08 PDT 2020


rnk added inline comments.


================
Comment at: llvm/lib/Support/Parallel.cpp:73
       for (size_t i = 1; i < ThreadCount; ++i) {
         std::thread([=] { work(); }).detach();
       }
----------------
I've belatedly realized that this means that LLVM is doing thread management on its own, i.e. every linker invocation spawns `hardware_concurrency()` threads. My understanding is that ConCRT is built on the system worker thread pool, which helps prevent oversubscription of CPU resources.

While @aganea measured that this change improved benchmarks, this change could lead to bad throughput when multiple link jobs run concurrently. Today, LLD is not very parallel, but this may become more of an issue as we use more and more parallelism for debug info merging. At some point in the future, we should try measuring the impact of this change on the performance of three links running in parallel, and see if using the NT worker pool gives benefits in that case. For now, though, let's not get ahead of ourselves with unmeasured concerns and leave this as is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68820





More information about the llvm-commits mailing list