# Threads and stdlib Random

**URL:** <https://discourse.julialang.org/t/threads-and-stdlib-random/57539>\
**Category:** General Usage\
**Created:** [March 19, 2021, 1:55pm UTC](https://discourse.julialang.org/t/threads-and-stdlib-random/57539 "2021-03-19T13:55:02Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [March 19, 2021, 4:27pm UTC](https://discourse.julialang.org/t/threads-and-stdlib-random/57539/5 "2021-03-19T16:27:25Z")

</div>

This works as well, I like I can choose to have a (a) random script, (b) deterministic script with individually random functions (same run of the script/model, same output) or (c) deterministic functions (same call with same input, same output), but it requires Julia \>= 1.5:

> [@Multithreaded random: different behaviour in Julia \>= 1.5 (not just different stream)](https://discourse.julialang.org/t/multithreaded-random-different-behaviour-in-julia-1-5-not-just-different-stream/57291):
>
> Hi, I just realised that my solution below for multithreaded random number generators works only in Julia \>= 1.5. In particular the test of “CASE A” fails, i.e. the two repetitions issue the same number. Is there a way to get the same framework working on Julia \<= 1.4 ? using Random, Test, Future, Statistics FIXEDRNG = MersenneTwister(123) function generateParallelRngs(rng::AbstractRNG, n::Integer) step = rand(rng,big(10)^20:big(10)^40) # making the step random too ! rngs = Vector{U…

---

_[View the full topic](https://discourse.julialang.org/t/threads-and-stdlib-random/57539)._
