Skip to content

Commit

Permalink
Docs and news for JuliaLang#38952 (JuliaLang#39032)
Browse files Browse the repository at this point in the history
* Update the docs for the `JULIA_NUM_THREADS` environment variable
* Add NEWS for JuliaLang#38952
  • Loading branch information
DilumAluthge committed Jan 11, 2021
1 parent 986b8b7 commit b260a25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Command-line option changes

Multi-threading changes
-----------------------

* 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])

Build system changes
--------------------
Expand Down
18 changes: 11 additions & 7 deletions doc/src/manual/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,24 @@ a master process to establish a connection before dying.
### [`JULIA_NUM_THREADS`](@id JULIA_NUM_THREADS)

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

!!! note
If `$JULIA_NUM_THREADS` is set to `auto`, then the number of threads will be set
to the number of CPU threads.

`JULIA_NUM_THREADS` must be defined before starting julia; defining it in `startup.jl` is too late in the startup process.
!!! note
`JULIA_NUM_THREADS` must be defined before starting julia; defining it in
`startup.jl` is too late in the startup process.

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

!!! compat "Julia 1.7"
The `auto` value for `$JULIA_NUM_THREADS` requires Julia 1.7 or above.

### `JULIA_THREAD_SLEEP_THRESHOLD`

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

0 comments on commit b260a25

Please sign in to comment.