Skip to content

Commit

Permalink
Work around JuliaLang/julia#40626.
Browse files Browse the repository at this point in the history
Fixes #866
[skip tests]
  • Loading branch information
maleadt committed Apr 28, 2021
1 parent a6d1eec commit ce2004d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/usage/multitasking.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ function run(a, b)
@sync begin
@async begin
results[1] = Array(compute(a,b))
nothing # JuliaLang/julia#40626
end
@async begin
results[2] = Array(compute(a,b))
nothing # JuliaLang/julia#40626
end
end

Expand Down Expand Up @@ -89,9 +91,11 @@ function run(a, b)
@sync begin
@async begin
copyto!(results[1], compute(a,b))
nothing # JuliaLang/julia#40626
end
@async begin
copyto!(results[2], compute(a,b))
nothing # JuliaLang/julia#40626
end
end

Expand Down Expand Up @@ -121,9 +125,11 @@ function run(a, b)
@sync begin
Threads.@spawn begin
results[1] = Array(compute(a,b))
nothing # JuliaLang/julia#40626
end
Threads.@spawn begin
results[2] = Array(compute(a,b))
nothing # JuliaLang/julia#40626
end
end

Expand Down

0 comments on commit ce2004d

Please sign in to comment.