diff --git a/doc/stdlib/parallel.rst b/doc/stdlib/parallel.rst index ecf344e9d2b1b..654e5188f454a 100644 --- a/doc/stdlib/parallel.rst +++ b/doc/stdlib/parallel.rst @@ -234,6 +234,18 @@ General Parallel Computing Support Fetch the value of a remote reference, removing it so that the reference is empty again. + procList = addprocs(1) # add another process + rr = RemoteRef(procList[1]) # create a remote reference on the next process + @everywhere function f(inRR::RemoteRef) + x = take!(inRR) + put!(inRR, x ^ 2) + end + @spawnat procList[1] f(rr) + put!(rr, 8) + @show( take!(rr) ) # => 64 + put!(rr, 8) + @show( take!(rr) ) # => 8 + .. function:: isready(r::RemoteRef) Determine whether a ``RemoteRef`` has a value stored to it. Note that this function