# How to make a variable available on all processes (when using Distributed)

**URL:** <https://discourse.julialang.org/t/how-to-make-a-variable-available-on-all-processes-when-using-distributed/128460>\
**Category:** General Usage\
**Tags:** distributed, parallel-computing\
**Created:** [April 27, 2025, 11:41am UTC](https://discourse.julialang.org/t/how-to-make-a-variable-available-on-all-processes-when-using-distributed/128460 "2025-04-27T11:41:32Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [April 27, 2025, 8:35pm UTC](https://discourse.julialang.org/t/how-to-make-a-variable-available-on-all-processes-when-using-distributed/128460/21 "2025-04-27T20:35:37Z")

</div>

> [@Torkel](#):
>
> ). I figured that Multithreading (and I am by no means an expert on this kind of things) wasn’t able to achieve as good parallelisation as making it distributed (which seemed very parallel when I got it to work and a good speedup).

As a rule of thumb: Use threads if there aren’t any hard reason why you can’t. Processes have a lot more overhead. Scenarios where you need processes/Distributed:

- part of the conputation runs on different _machines_
- you load some library that is not thread-safe (each process loads its own copy of the lib so you can safely parallelize calls to the library using processes)

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [April 28, 2025, 8:43am UTC](https://discourse.julialang.org/t/how-to-make-a-variable-available-on-all-processes-when-using-distributed/128460/22 "2025-04-28T08:43:21Z")

</div>

Ok, really soundsl ike I shoudl try and figure out how to get the threading to work, thanks!

[Previous page](https://discourse.julialang.org/t/how-to-make-a-variable-available-on-all-processes-when-using-distributed/128460.md?page=1)
