Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set background thread priority on index threads #538

Merged
merged 1 commit into from
Dec 28, 2019

Conversation

eklitzke
Copy link
Contributor

@eklitzke eklitzke commented Dec 3, 2019

Previously I created #537 which uses the Linux-specific SCHED_BATCH, but then I noticed that LLVM has a platform-agnostic way of doing this that works on Windows, macOS, etc. Note that the LLVM implementation uses SCHED_IDLE on Linux which is much more extreme than SCHED_BATCH, but probably still OK for the indexer 🤷

@MaskRay
Copy link
Owner

MaskRay commented Dec 3, 2019

It is not very clear what pthread_setschedparam(pthread_self(), SCHED_IDLE, ...) will achieve. Have you noticed any difference with this setting?

@eklitzke
Copy link
Contributor Author

eklitzke commented Dec 3, 2019

It is not very clear what pthread_setschedparam(pthread_self(), SCHED_IDLE, ...) will achieve. Have you noticed any difference with this setting?

Moved discussion to #536 as these are similar.

@@ -255,6 255,9 @@ void *indexer(void *arg_) {
delete arg;
std::string name = "indexer" std::to_string(idx);
set_thread_name(name.c_str());
#if defined(LLVM_ENABLE_THREADS) && LLVM_VERSION_MAJOR >= 9
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if LLVM_ENABLE_THREADS && LLVM_VERSION_MAJOR >= 9

llvm/include/llvm/Config/llvm-config.h.cmake says
says #cmakedefine01 LLVM_ENABLE_THREADS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants