# How can I change a variable from one process to another if the two processes are on different machines?

**URL:** <https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199>\
**Category:** New to Julia\
**Tags:** parallel, distributed\
**Created:** [August 28, 2021, 2:55am UTC](https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199 "2021-08-28T02:55:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 28, 2021, 2:15pm UTC](https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199/2 "2021-08-28T14:15:05Z")

</div>

I’m not an expert on this, but I’ll respond because nobody else has taken it.

A worked out example of distributed computing can be found here:

> [@The ultimate guide to distributed computing](https://discourse.julialang.org/t/the-ultimate-guide-to-distributed-computing/41867):
>
> HOWTO: Distributed computing In this thread I would like to put together relevant information for people interested in distributing simple function calls on multiple cluster nodes. Although the task is simple, there are some rough (undocumented) corners in the language that inhibit even experienced users from accomplishing it currently. The idea here is to update this content every now and then to reflect the latest (and cleanest) way of performing distributed computing with remote workers in…

For your first question, it sounds like you are looking for a SharedArray.  
For the second, to prevent a race condition you would use a lock (pointer in the above thread). But I may misunderstand what you are asking for in your last paragraph.

---

_[View the full topic](https://discourse.julialang.org/t/how-can-i-change-a-variable-from-one-process-to-another-if-the-two-processes-are-on-different-machines/67199)._
