@@ -342,7 +342,7 @@ function init_proc(state, p, log_sink)
342
342
lock (WORKER_MONITOR_LOCK) do
343
343
wid = p. pid
344
344
if ! haskey (WORKER_MONITOR_TASKS, wid)
345
- t = @async begin
345
+ t = Threads . @spawn begin
346
346
try
347
347
# Wait until this connection is terminated
348
348
remotecall_fetch (sleep, wid, typemax (UInt64))
@@ -505,7 +505,7 @@ function scheduler_init(ctx, state::ComputeState, d::Thunk, options, deps)
505
505
506
506
# Initialize workers
507
507
@sync for p in procs_to_use (ctx)
508
- @async begin
508
+ Threads . @spawn begin
509
509
try
510
510
init_proc (state, p, ctx. log_sink)
511
511
catch err
@@ -521,7 +521,7 @@ function scheduler_init(ctx, state::ComputeState, d::Thunk, options, deps)
521
521
end
522
522
523
523
# Listen for new workers
524
- @async begin
524
+ Threads . @spawn begin
525
525
try
526
526
monitor_procs_changed! (ctx, state)
527
527
catch err
@@ -632,7 +632,7 @@ function scheduler_exit(ctx, state::ComputeState, options)
632
632
@dagdebug nothing :global " Tearing down scheduler" uid= state. uid
633
633
634
634
@sync for p in procs_to_use (ctx)
635
- @async cleanup_proc (state, p, ctx. log_sink)
635
+ Threads . @spawn cleanup_proc (state, p, ctx. log_sink)
636
636
end
637
637
638
638
lock (state. lock) do
988
988
function evict_all_chunks! (ctx, to_evict)
989
989
if ! isempty (to_evict)
990
990
@sync for w in map (p-> p. pid, procs_to_use (ctx))
991
- @async remote_do (evict_chunks!, w, ctx. log_sink, to_evict)
991
+ Threads . @spawn remote_do (evict_chunks!, w, ctx. log_sink, to_evict)
992
992
end
993
993
end
994
994
end
@@ -1075,8 +1075,7 @@ function fire_tasks!(ctx, thunks::Vector{<:Tuple}, (gproc, proc), state)
1075
1075
# know which task failed.
1076
1076
tasks = Task[]
1077
1077
for ts in to_send
1078
- # TODO : errormonitor
1079
- @async begin
1078
+ task = Threads. @spawn begin
1080
1079
timespan_start (ctx, :fire , (;worker= gproc. pid), nothing )
1081
1080
try
1082
1081
remotecall_wait (do_tasks, gproc. pid, proc, state. chan, [ts]);
@@ -1523,7 +1522,7 @@ function do_task(to_proc, task_desc)
1523
1522
(data, ids)
1524
1523
end
1525
1524
fetch_tasks = map (Iterators. zip (_data,_ids)) do (x, id)
1526
- @async begin
1525
+ Threads . @spawn begin
1527
1526
timespan_start (ctx, :move , (;thunk_id, id, processor= to_proc), (;f, data= x))
1528
1527
#= FIXME : This isn't valid if x is written to
1529
1528
x = if x isa Chunk
0 commit comments