You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test works. But take out the Semaphore and it hangs and/or scrambles the results. Perhaps Reduce.jl should be using a semaphore/mutex internally? This problem arose when I was using Reduce.jl with Genie.jl, and it caused some hard to debug problems, such as one HTTP request hanging until the next request came in, or having rcall return the result from someone else's query.
using Reduce
reduce_sem = Base.Semaphore(1)
println("create")
tasks = []
for i in 1:10
t = @task begin
println("begin $i")
Base.acquire(reduce_sem)
println("rcall $i")
y = :($i * x) |> rcall
println("$i -> $y")
Base.release(reduce_sem)
println("released")
end
push!(tasks, t)
end
println("schedule")
for t in tasks
schedule(t)
end
println("wait")
for t in tasks
wait(t)
end
The text was updated successfully, but these errors were encountered:
The following test works. But take out the Semaphore and it hangs and/or scrambles the results. Perhaps Reduce.jl should be using a semaphore/mutex internally? This problem arose when I was using Reduce.jl with Genie.jl, and it caused some hard to debug problems, such as one HTTP request hanging until the next request came in, or having rcall return the result from someone else's query.
The text was updated successfully, but these errors were encountered: