Number of available threads in Julia?

Viewed 737

In Julia is it still the case that the number of threads that can be created is limited by the number of physically available cores? Or has Julia lang changed since March so that the number of threads is limited to the number of logical cores?

1 Answers

The restriction was lifted with PR #36778, so in Julia master (what in a few months will become v1.6) you can start Julia with as many threads as you want:

% julia-master --threads 20 -q
julia> using Base.Threads

julia> nthreads()
20

You can use --threads auto (or -t auto) to start Julia with the number of threads available on the system:

% julia-master --threads auto -q                
julia> using Base.Threads

julia> nthreads()
8
Related