From ccda834f19573dba0565ea50240dfbb5c602afce Mon Sep 17 00:00:00 2001 From: Daniel Wennberg Date: Tue, 24 Sep 2024 19:08:42 -0700 Subject: [PATCH 1/2] Update TaskLocalRNG docstring according to #49110 --- stdlib/Random/src/Xoshiro.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/Random/src/Xoshiro.jl b/stdlib/Random/src/Xoshiro.jl index 1909effbbc9e6..b89c08d1e453b 100644 --- a/stdlib/Random/src/Xoshiro.jl +++ b/stdlib/Random/src/Xoshiro.jl @@ -185,8 +185,8 @@ end TaskLocalRNG The `TaskLocalRNG` has state that is local to its task, not its thread. -It is seeded upon task creation, from the state of its parent task. -Therefore, task creation is an event that changes the parent's RNG state. +It is seeded upon task creation, from the state of its parent task, but without +advancing the state of the parent's RNG. As an upside, the `TaskLocalRNG` is pretty fast, and permits reproducible multithreaded simulations (barring race conditions), independent of scheduler From 1bd632a81000f911abb44fa16436455c1f811a83 Mon Sep 17 00:00:00 2001 From: Daniel Wennberg Date: Tue, 24 Sep 2024 21:50:23 -0700 Subject: [PATCH 2/2] Add compat note --- stdlib/Random/src/Xoshiro.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/Random/src/Xoshiro.jl b/stdlib/Random/src/Xoshiro.jl index b89c08d1e453b..09a3e386e9a2b 100644 --- a/stdlib/Random/src/Xoshiro.jl +++ b/stdlib/Random/src/Xoshiro.jl @@ -203,6 +203,9 @@ may be any integer. !!! compat "Julia 1.11" Seeding `TaskLocalRNG()` with a negative integer seed requires at least Julia 1.11. + +!!! compat "Julia 1.10" + Task creation no longer advances the parent task's RNG state as of Julia 1.10. """ struct TaskLocalRNG <: AbstractRNG end TaskLocalRNG(::Nothing) = TaskLocalRNG()