[PATCH] D53651: [clangd] Use thread pool for background indexing.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 30 03:33:30 PDT 2018


kadircet added inline comments.


================
Comment at: clangd/Threading.cpp:102
+void setThreadPriority(std::thread &T, ThreadPriority Priority) {
+#ifdef HAVE_PTHREAD_H
+  sched_param priority;
----------------
sammccall wrote:
> don't you also need to actually include it?
Turns out it was included transitively.


================
Comment at: clangd/index/Background.h:19
 #include "llvm/Support/SHA1.h"
+#include "TUScheduler.h"
 #include <condition_variable>
----------------
ilya-biryukov wrote:
> sammccall wrote:
> > depending on TUScheduler doesn't make sense here. Move the function to Threading.h instead?
> Maybe move the `getDefaultAsyncThreadsCount` into `Threading.h`?
> Having a dependency on TUScheduler in Background indexing is a bit misleading, since we're not actually sharing any threading infrastructure there.
actually there is one in llvm with the same semantics we use(never return zero) `llvm::hardware_concurrency`


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53651





More information about the cfe-commits mailing list