Skip to content

Commit 082ec88

Browse files
committed
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.
1 parent 8221c87 commit 082ec88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/manual/parallel-computing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ julia> for p in workers() # start tasks on the workers to process requests in pa
10881088
julia> @elapsed while n > 0 # print out results
10891089
job_id, exec_time, where = take!(results)
10901090
println("$job_id finished in $(round(exec_time; digits=2)) seconds on worker $where")
1091-
n = n - 1
1091+
global n = n - 1
10921092
end
10931093
1 finished in 0.18 seconds on worker 4
10941094
2 finished in 0.26 seconds on worker 5

0 commit comments

Comments
 (0)