[PATCH] D69582: Let clang driver support parallel jobs

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 11:21:59 PDT 2019


thakis added inline comments.


================
Comment at: clang/lib/Driver/Compilation.cpp:303
+    }
+    std::thread Th(Work);
+    Th.detach();
----------------
Maybe a select() / fork() loop is a better approach than spawning one thread per subprocess? This is doing thread-level parallelism in addition to process-level parallelism :)

If llvm doesn't have a subprocess pool abstraction yet, ninja's is pretty small, self-contained, battle-tested and open-source, maybe you could copy that over (and remove bits you don't need)?

https://github.com/ninja-build/ninja/blob/master/src/subprocess.h
https://github.com/ninja-build/ninja/blob/master/src/subprocess-win32.cc
https://github.com/ninja-build/ninja/blob/master/src/subprocess-posix.cc


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

https://reviews.llvm.org/D69582





More information about the cfe-commits mailing list