Skip to content

Commit

Permalink
document thread safety for RNGs (#40109)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Mar 21, 2021
1 parent 6913f9c commit 7d117dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/Random/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ type, which is a wrapper over the OS provided entropy.
Most functions related to random generation accept an optional `AbstractRNG` object as first argument,
which defaults to the global one if not provided. Moreover, some of them accept optionally
dimension specifications `dims...` (which can be given as a tuple) to generate arrays of random
values.
values. In a multi-threaded program, you should generally use different RNG objects from different threads
in order to be thread-safe. However, the default global RNG is thread-safe as of Julia 1.3 (because
it internally corresponds to a per-thread RNG).

A `MersenneTwister` or `RandomDevice` RNG can generate uniformly random numbers of the following types:
[`Float16`](@ref), [`Float32`](@ref), [`Float64`](@ref), [`BigFloat`](@ref), [`Bool`](@ref),
Expand Down

2 comments on commit 7d117dc

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.