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?


#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.