From 484b5ca5af5cff0481566bf9bf514350cc33296a Mon Sep 17 00:00:00 2001 From: Israel Herraiz Date: Thu, 23 Aug 2018 12:03:13 +0200 Subject: [PATCH] @schedule is deprecated, the code is no longer valid in 1.0 (#28800) * @schedule is deprecated, the code is no longer valid in 1.0 * Additional changes for 1.0 compliance --- doc/src/manual/parallel-computing.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/manual/parallel-computing.md b/doc/src/manual/parallel-computing.md index a07312182904b..5b5570dc5d105 100644 --- a/doc/src/manual/parallel-computing.md +++ b/doc/src/manual/parallel-computing.md @@ -77,7 +77,7 @@ A channel can be visualized as a pipe, i.e., it has a write end and a read end : # we can schedule `n` instances of `foo` to be active concurrently. for _ in 1:n - @schedule foo() + @async foo() end ``` * Channels are created via the `Channel{T}(sz)` constructor. The channel will only hold objects @@ -184,16 +184,16 @@ julia> function make_jobs(n) julia> n = 12; -julia> @schedule make_jobs(n); # feed the jobs channel with "n" jobs +julia> @async make_jobs(n); # feed the jobs channel with "n" jobs julia> for i in 1:4 # start 4 tasks to process requests in parallel - @schedule do_work() + @async do_work() end julia> @elapsed while n > 0 # print out results job_id, exec_time = take!(results) - println("$job_id finished in $(round(exec_time,2)) seconds") - n = n - 1 + println("$job_id finished in $(round(exec_time; digits=2)) seconds") + global n = n - 1 end 4 finished in 0.22 seconds 3 finished in 0.45 seconds