Details
- Reviewers
ilya-biryukov gribozavr - Commits
- rGc6a1d4911033: Merging r354765: --------------------------------------------------------------…
rL354983: Merging r354765:
rGf47177ddb45d: [clangd] Add thread priority lowering for MacOS as well
rL354765: [clangd] Add thread priority lowering for MacOS as well
rCTE354765: [clangd] Add thread priority lowering for MacOS as well
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 28365 Build 28364: arc lint + arc unit
Event Timeline
Not an expert on MacOS threading APIs, only checked this builds on Mac.
@gribozavr could you confirm using these APIs is the right thing to do on Mac?
clangd/Threading.cpp | ||
---|---|---|
126 | Could you add a corresponding #include directive on Mac (#include <sys/resource.h>)? |
clangd/Threading.cpp | ||
---|---|---|
125 | This points into iPhoneOS docs, might be confusing. |
macOS supports pthread_setschedparam() that we call on Linux, why not reuse the same code path?
This one was used in a few different places in clang, for ex: https://github.com/llvm-mirror/clang/blob/master/tools/libclang/CIndex.cpp#L8713. Therefore I've used the same funcitonality.
Regarding pthread_setschedparam does setting prioirty to PTHREAD_MIN_PRIORITY on either SCHED_FIFO or SCHED_RR policy corresponds to SCHED_IDLE in linux(http://man7.org/linux/man-pages/man7/sched.7.html)?
clangd/Threading.cpp | ||
---|---|---|
125 | It still says This document is a Mac OS X manual page. on top of the page, couldn't find any url that contains something like MacOS instead of iPhoneOS |
I see, there's no SCHED_IDLE in the macOS SDK. OK then, I trust that people who wrote CIndex.cpp support for macOS probably have got it correctly working for macOS, so it makes sense to do the same in clangd. Please consider factoring a function in libSupport though.
This points into iPhoneOS docs, might be confusing.
Is there a link for the desktop version of the OS somewhere?
Could also leave it out, I'm sure setpriority is easy to google.