Skip to content

Commit

Permalink
Fix RemoteChannel example in parallel-computing.md
Browse files Browse the repository at this point in the history
The example demonstrating the use of RemoteChannel does not work in Julia 0.7+,
due to new scoping of variables inside of for loops. Consequently, the example
would not work as intended. Adding global scope to the variable corrects this
problem.

(cherry picked from commit 082ec88)
  • Loading branch information
galenlynch authored and KristofferC committed Feb 11, 2019
1 parent 4728b66 commit d309c4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/src/manual/parallel-computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ julia> for p in workers() # start tasks on the workers to process requests in pa
julia> @elapsed while n > 0 # print out results
job_id, exec_time, where = take!(results)
println("$job_id finished in $(round(exec_time; digits=2)) seconds on worker $where")
n = n - 1
global n = n - 1
end
1 finished in 0.18 seconds on worker 4
2 finished in 0.26 seconds on worker 5
Expand Down

0 comments on commit d309c4b

Please sign in to comment.