ilya-biryukov added inline comments.
================
Comment at: clangd/Threading.h:125
+// Sets scheduling priority for the calling thread.
+void setThreadPriority(ThreadPriority Priority);
// Avoid the use of scheduler policies that may starve low-priority threads.
----------------
Maybe change the name to `setCurrentThreadPrority`?
The change itself LG, there does not seem to be a way to get the native handle
from `std::this_thread`...
================
Comment at: clangd/index/Background.cpp:190
+ // this to support tasks with various priorities.
+ setThreadPriority(ThreadPriority::Low);
Cmd.CommandLine.push_back("-resource-dir=" + ResourceDir);
----------------
Maybe make this a parameter of `enqueueTask`, probably with
`ThreadPriority::Low` being the default?
Seems to be an appropriate place, `enqueueTask` is a starting point for
scheduling and task priority is inherently a property that the scheduler cares
about.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55315/new/
https://reviews.llvm.org/D55315
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits