# Variables on remote processes

**URL:** <https://discourse.julialang.org/t/variables-on-remote-processes/26256>\
**Category:** General Usage\
**Created:** [July 11, 2019, 5:32pm UTC](https://discourse.julialang.org/t/variables-on-remote-processes/26256 "2019-07-11T17:32:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [July 11, 2019, 5:32pm UTC](https://discourse.julialang.org/t/variables-on-remote-processes/26256/1 "2019-07-11T17:32:05Z")

</div>

The following uses always the locally defined variable:

```julia
using Distributed
addprocs(1)

@everywhere c = 10
c = 3
pmap(1:1) do i
       c
end # 3

@everywhere f(x) = c
pmap(f, 1:1) # 3

```

How can I guarantee that my function uses the remotely defined variable?

The only way to get it to use the remotely defined variable is to _not_ have it defined locally, but I don’t really want to rely on this:

```julia
@everywhere d = 2
pmap(1:1) do i
       d
end # 2

```
