How to change the number of threads?

parallel
multithreading

#1

How to change the number of threads? Currently it is one for me:

julia> Threads.nthreads()
1

Is there a function/command line flag to add more threads? Is this documented somewhere?


Threads.nthreads(): different results in Atom and in Julia built-in REPL
#2

Set the JULIA_NUM_THREADS environment variable. See https://docs.julialang.org/en/stable/manual/parallel-computing/#Multi-Threading-(Experimental)-1 and https://docs.julialang.org/en/stable/manual/environment-variables/#JULIA_NUM_THREADS-1.


#3

In case anyone is searching for this, the correct links are now
https://docs.julialang.org/en/v1.0/manual/parallel-computing/#Multi-Threading-(Experimental)-1
and
https://docs.julialang.org/en/v1.0/manual/environment-variables/#JULIA_NUM_THREADS-1