# Best practices for using random number generators with threads

**URL:** <https://discourse.julialang.org/t/best-practices-for-using-random-number-generators-with-threads/32158>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 11, 2019, 4:23pm UTC](https://discourse.julialang.org/t/best-practices-for-using-random-number-generators-with-threads/32158 "2019-12-11T16:23:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [December 11, 2019, 4:23pm UTC](https://discourse.julialang.org/t/best-practices-for-using-random-number-generators-with-threads/32158/1 "2019-12-11T16:23:02Z")

</div>

In a single-threaded simulation it is common to pass the random number generator, of type `AbstractRNG` as the first argument in the method that actually performs the simulation and have another method without this argument that calls the first method with `Random.GLOBAL_RNG` in that position.

I see from documentation for `Random.seed!` in julia-1.3.0 that there is a shared thread-local generator but I haven’t been able to find much more documentation on random number generators and threads. Is there some place I can check for such an explanation. Obviously I can check the code itself but I don’t want to miss an easier way of discovering how to do things.
