-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
threading deadlock: change jl_fptr_wait_for_compiled to actually comp…
…ile code The jl_fptr_wait_for_compiled state merely means it could compile that code, but in many circumstances, it will not actually compile that code until a long delay: when either all edges are satisfied or it is demanded to run immediately. The previous logic did not handle that possibility leading to deadlocks (possible even on one thread). A high rate of failure was shown on running the following CI test: $ ./julia -t 20 -q <<EOF for i = 1:1000 i % 10 == 0 && @show i (@eval function _atthreads_greedy_dynamic_schedule() inc = Threads.Atomic{Int}(0) Threads.@threads :greedy for _ = 1:Threads.threadpoolsize() Threads.@threads :dynamic for _ = 1:Threads.threadpoolsize() Threads.atomic_add!(inc, 1) end end return inc[] end)() == Threads.threadpoolsize() * Threads.threadpoolsize() end EOF
- Loading branch information
Showing
3 changed files
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters