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

Limit default GC threads to 8 #52352

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,12 @@ void jl_init_threading(void)
if (jl_n_markthreads + 1 >= cpu) {
jl_n_markthreads = cpu - 1;
}
// if `--gcthreads` or ENV[NUM_GCTHREADS_NAME] was not specified,
// cap the number of threads that may ran the mark phase
// to MAX_DEFAULT_GC_THREADS as defined in threading.h
if (jl_n_markthreads > (MAX_DEFAULT_GC_THREADS)) {
jl_n_markthreads = (MAX_DEFAULT_GC_THREADS);
}
}
}
// warn the user if they try to run with a number
Expand Down
1 change: 1 addition & 0 deletions src/threading.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern "C" {
#include "julia.h"

#define PROFILE_JL_THREADING 0
#define MAX_DEFAULT_GC_THREADS 8

extern _Atomic(jl_ptls_t*) jl_all_tls_states JL_GLOBALLY_ROOTED; /* thread local storage */

Expand Down