# Send a function to worker processes

**URL:** <https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696>\
**Category:** General Usage\
**Tags:** parallel\
**Created:** [February 12, 2019, 9:49am UTC](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696 "2019-02-12T09:49:23Z")\
**Posts on this page:** 3\
**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:** [February 12, 2019, 9:49am UTC](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696/1 "2019-02-12T09:49:24Z")

</div>

Is there an easy way to send a function that is already defined to all worker processes? E.g.:

```julia
julia> f(x) = x + 1

julia> @everywhere f = $f

```

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [February 12, 2019, 12:36pm UTC](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696/2 "2019-02-12T12:36:36Z")

</div>

Check out ParallelDataTransfer.jl

---

<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:** [February 12, 2019, 1:57pm UTC](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696/3 "2019-02-12T13:57:51Z")

</div>

Sorry, but I cannot figure it out.

```julia
addprocs(2)
f(x) = 2x
sendto(workers(), f = f)
@everywhere print(f(3))

```

still complains that `f` is not defined.
