File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -478,16 +478,10 @@ JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT
478478
479479JL_DLLEXPORT int jl_effective_threads (void ) JL_NOTSAFEPOINT
480480{
481- int n = uv_available_parallelism ();
482- #if defined(__APPLE__ ) && defined(_CPU_AARCH64_ )
483- // Only on Apple Silicon we don't just return `uv_available_parallelism` because it may
484- // be larger than `jl_cpu_threads` (which asks for the performance cores only), and we
485- // want the more conservative estimate of the two.
486- int cpu = jl_cpu_threads ();
487- return n < cpu ? n : cpu ;
488- #else
489- return n ;
490- #endif
481+ // We want the more conservative estimate of the two.
482+ int cpu_threads = jl_cpu_threads ();
483+ int available_parallelism = uv_available_parallelism ();
484+ return available_parallelism < cpu_threads ? available_parallelism : cpu_threads ;
491485}
492486
493487
You can’t perform that action at this time.
0 commit comments