Overview of the Random module
masterThe Random module provides pseudorandom number generation (PRNG) in Julia. By default, Julia uses the Xoshiro256++ algorithm with per-Task state.
Key PRNG Types
TaskLocalRNG: A token representing the currently active Task-local stream. It is deterministically seeded from the parent task or viaRandomDeviceat program start.Xoshiro: A high-performance, high-quality PRNG using the Xoshiro256++ algorithm with a small state vector.RandomDevice: Provides OS-provided entropy, suitable for cryptographically secure random numbers (CS(P)RNG).MersenneTwister: A high-quality PRNG (the previous Julia default) that is fast but requires a larger state vector thanXoshiro.
Thread Safety
In multi-threaded programs, you should generally use different RNG objects for different threads or tasks to ensure thread safety. As of Julia 1.3, the default RNG is thread-safe (using per-thread RNG up to version 1.6, and per-task thereafter).