Skip to content

Commit 3163077

Browse files
DilumAluthgeElOceanografo
authored andcommitted
Docs and news for JuliaLang#38952 (JuliaLang#39032)
* Update the docs for the `JULIA_NUM_THREADS` environment variable * Add NEWS for JuliaLang#38952
1 parent 0935c63 commit 3163077

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Command-line option changes
1818

1919
Multi-threading changes
2020
-----------------------
21-
21+
* If the `JULIA_NUM_THREADS` environment variable is set to `auto`, then the number of threads will be set to the number of CPU threads ([#38952])
2222

2323
Build system changes
2424
--------------------

doc/src/manual/environment-variables.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,24 @@ a master process to establish a connection before dying.
190190
### [`JULIA_NUM_THREADS`](@id JULIA_NUM_THREADS)
191191

192192
An unsigned 64-bit integer (`uint64_t`) that sets the maximum number of threads
193-
available to Julia. If `$JULIA_NUM_THREADS` exceeds the number of available
194-
CPU threads (logical cores), then the number of threads is set to the number of CPU threads. If
195-
`$JULIA_NUM_THREADS` is not positive or is not set, or if the number of CPU
196-
threads cannot be determined through system calls, then the number of threads is
197-
set to `1`.
193+
available to Julia. If `$JULIA_NUM_THREADS` is not positive or is not set, or
194+
if the number of CPU threads cannot be determined through system calls, then the
195+
number of threads is set to `1`.
198196

199-
!!! note
197+
If `$JULIA_NUM_THREADS` is set to `auto`, then the number of threads will be set
198+
to the number of CPU threads.
200199

201-
`JULIA_NUM_THREADS` must be defined before starting julia; defining it in `startup.jl` is too late in the startup process.
200+
!!! note
201+
`JULIA_NUM_THREADS` must be defined before starting julia; defining it in
202+
`startup.jl` is too late in the startup process.
202203

203204
!!! compat "Julia 1.5"
204205
In Julia 1.5 and above the number of threads can also be specified on startup
205206
using the `-t`/`--threads` command line argument.
206207

208+
!!! compat "Julia 1.7"
209+
The `auto` value for `$JULIA_NUM_THREADS` requires Julia 1.7 or above.
210+
207211
### `JULIA_THREAD_SLEEP_THRESHOLD`
208212

209213
If set to a string that starts with the case-insensitive substring `"infinite"`,

0 commit comments

Comments
 (0)