From d309c4b60e2bf3502f5dfca563e6391e175eb99b Mon Sep 17 00:00:00 2001 From: Galen Lynch Date: Fri, 18 Jan 2019 20:26:47 -0500 Subject: [PATCH] Fix RemoteChannel example in parallel-computing.md 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 082ec8841202c2d1876c0290f49813120a7e8a2b) --- doc/src/manual/parallel-computing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/manual/parallel-computing.md b/doc/src/manual/parallel-computing.md index e0071085f2bc5..7c2a3f31ba431 100644 --- a/doc/src/manual/parallel-computing.md +++ b/doc/src/manual/parallel-computing.md @@ -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