Skip to content

Commit 9cca017

Browse files
committed
Sch: Run scheduler on thread 1 only
1 parent c00a9d5 commit 9cca017

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sch/eager.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ function init_eager()
2323
return
2424
end
2525
ctx = eager_context()
26-
errormonitor_tracked("eager compute()", Threads.@spawn try
26+
# N.B. We use @async here to prevent the scheduler task from running on a
27+
# different thread than the one that is likely submitting work, as otherwise
28+
# the scheduler task might sleep while holding the scheduler lock and
29+
# prevent work submission until it wakes up. Further testing is needed.
30+
errormonitor_tracked("eager compute()", @async try
2731
sopts = SchedulerOptions(;allow_errors=true)
2832
opts = Dagger.Options((;scope=Dagger.ExactScope(Dagger.ThreadProc(1, 1)),
2933
occupancy=Dict(Dagger.ThreadProc=>0),

0 commit comments

Comments
 (0)