# Poor performance on cluster multithreading

**URL:** <https://discourse.julialang.org/t/poor-performance-on-cluster-multithreading/12248>\
**Category:** Performance\
**Tags:** performance, parallel, multithreading, cluster\
**Created:** [July 8, 2018, 1:09pm UTC](https://discourse.julialang.org/t/poor-performance-on-cluster-multithreading/12248 "2018-07-08T13:09:12Z")\
**Posts on this page:** 1\
**Page:** 3

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [July 11, 2018, 2:18pm UTC](https://discourse.julialang.org/t/poor-performance-on-cluster-multithreading/12248/41 "2018-07-11T14:18:36Z")

</div>

And I’m pretty sure I’ve pasted the link to this code before on a different thread (there’re already a dozen threads about this here…) [Here](https://github.com/nacs-lab/yyc-data/blob/d082032d075070b133fe909c724ecc405e80526a/lib/NaCsCalc/src/utils.jl#L120-L142) is what I use to lazily initialize the RNG on each thread (it’s not using independent ones since I don’t really care about that for my current application and the code was written before the current randjmp is implemented). The lazy initialization avoid the 1s busy wait at initialization time on each thread as a side effect of `@thread`.

[Previous page](https://discourse.julialang.org/t/poor-performance-on-cluster-multithreading/12248.md?page=2)
