Skip to content

Commit c601b11

Browse files
authored
Update TaskLocalRNG docstring according to #49110 (#55863)
Since #49110, which is included in 1.10 and 1.11, spawning a task no longer advances the parent task's RNG state, so this statement in the docs was incorrect.
1 parent 25cbe00 commit c601b11

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/Random/src/Xoshiro.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ end
185185
TaskLocalRNG
186186
187187
The `TaskLocalRNG` has state that is local to its task, not its thread.
188-
It is seeded upon task creation, from the state of its parent task.
189-
Therefore, task creation is an event that changes the parent's RNG state.
188+
It is seeded upon task creation, from the state of its parent task, but without
189+
advancing the state of the parent's RNG.
190190
191191
As an upside, the `TaskLocalRNG` is pretty fast, and permits reproducible
192192
multithreaded simulations (barring race conditions), independent of scheduler
@@ -203,6 +203,9 @@ may be any integer.
203203
204204
!!! compat "Julia 1.11"
205205
Seeding `TaskLocalRNG()` with a negative integer seed requires at least Julia 1.11.
206+
207+
!!! compat "Julia 1.10"
208+
Task creation no longer advances the parent task's RNG state as of Julia 1.10.
206209
"""
207210
struct TaskLocalRNG <: AbstractRNG end
208211
TaskLocalRNG(::Nothing) = TaskLocalRNG()

0 commit comments

Comments
 (0)