# Understanding pid and RRID in 'Future' objects (related to @spawn and @spawnat in documentation)

**URL:** <https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462>\
**Category:** New to Julia\
**Tags:** question, documentation\
**Created:** [March 2, 2018, 6:08pm UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462 "2018-03-02T18:08:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [March 2, 2018, 6:08pm UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462/1 "2018-03-02T18:08:31Z")

</div>

In the documentation on Parallel Computing the first code example contains:

```julia
julia> r = remotecall(rand, 2, 2, 2)
Future(2, 1, 4, Nullable{Any}())

julia> s = @spawnat 2 1 .+ fetch(r)
Future(2, 1, 5, Nullable{Any}())

```

Which makes sense to me (I think) because the first number field of the Future object, the pid, is 2 because both belong to process 2 and fetch is a no-op.

However, the second example:

```julia
julia> r = @spawn rand(2,2)
Future(2, 1, 4, Nullable{Any}())

julia> s = @spawn 1 .+ fetch(r)
Future(3, 1, 5, Nullable{Any}())

```

The pid for the object s appears to be 3, which I interpret as it belonging to process 3. Is this correct? If so, the text below this second example does not make sense:

> In this case, @spawn is smart enough to perform the computation on the process that owns r, so the fetch() will be a no-op (no work is done).

---

<div class="post-metadata">

**Author:** ![findmyway](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/findmyway/32/4946_2.png) [@findmyway](https://discourse.julialang.org/u/findmyway)\
**Post date:** [July 25, 2018, 4:12am UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462/2 "2018-07-25T04:12:37Z")

</div>

I have checked the source code. It seems the `@spawn` is not that smart yet…

> <https://github.com/JuliaLang/julia/blob/master/stdlib/Distributed/src/macros.jl>

😂 😂 😂

Can anyone help clarify this ?

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [July 25, 2018, 10:09am UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462/3 "2018-07-25T10:09:43Z")

</div>

Unfortunately I can’t edit the question anymore but in hindsight this doesn’t seem like a ‘first steps’ question as the answer may be quite involved 🙂

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [July 25, 2018, 5:37pm UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462/4 "2018-07-25T17:37:42Z")

</div>

If there’s no response before, I will ask around at JuliaCon2018 regarding this and report back. If I can’t figure it out by then I’ll post an issue on Github.

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [July 31, 2018, 10:01am UTC](https://discourse.julialang.org/t/understanding-pid-and-rrid-in-future-objects-related-to-spawn-and-spawnat-in-documentation/9462/5 "2018-07-31T10:01:27Z")

</div>

Update, decided to go ahead and put an issue on Github:

[https://github.com/JuliaLang/julia/issues/28350](https://github.com/JuliaLang/julia/issues/28350)
