Skip to content

Commit

Permalink
Merge pull request #13937 from ahwillia/patch-1
Browse files Browse the repository at this point in the history
Edit Docs: Add pointer to SharedArrays
  • Loading branch information
timholy committed Nov 10, 2015
2 parents 232855e + b78cf55 commit f174d12
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions doc/manual/parallel-computing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,13 @@ For example, the following code will not work as intended::

However, this code will not initialize all of ``a``, since each
process will have a separate copy of it. Parallel for loops like these
must be avoided. Fortunately, distributed arrays can be used to get
around this limitation (see the
`DistributedArrays.jl <https://github.com/JuliaParallel/DistributedArrays.jl>`_
package).
must be avoided. Fortunately, `Shared Arrays <#shared-arrays>`_
can be used to get around this limitation::

a = SharedArray(Float64,10)
@parallel for i=1:10
a[i] = i
end

Using "outside" variables in parallel loops is perfectly reasonable if
the variables are read-only::
Expand Down

0 comments on commit f174d12

Please sign in to comment.