Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah committed May 25, 2014
2 parents 226f039 + bca3454 commit 3bc8ef2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/manual/parallel-computing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ equal the number of CPU cores on the machine.
0.60401 0.501111
0.174572 0.157411

julia> s = @spawnat 2 1+fetch(r)
julia> s = @spawnat 2 1 .+ fetch(r)
RemoteRef(2,1,7)

julia> fetch(s)
Expand Down Expand Up @@ -98,14 +98,14 @@ a function, and picks where to do the operation for you::
julia> r = @spawn rand(2,2)
RemoteRef(1,1,0)

julia> s = @spawn 1+fetch(r)
julia> s = @spawn 1 .+ fetch(r)
RemoteRef(1,1,1)

julia> fetch(s)
1.10824216411304866 1.13798233877923116
1.12376292706355074 1.18750497916607167

Note that we used ``1+fetch(r)`` instead of ``1+r``. This is because we
Note that we used ``1 .+ fetch(r)`` instead of ``1 .+ r``. This is because we
do not know where the code will run, so in general a ``fetch`` might be
required to move ``r`` to the process doing the addition. In this
case, ``@spawn`` is smart enough to perform the computation on the
Expand Down

0 comments on commit 3bc8ef2

Please sign in to comment.