Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,10 @@ function enq_work(t::Task)
tid = 0
end
end
ccall(:jl_wakeup_thread, Cvoid, (Int16,), (tid - 1) % Int16)
# nosleep
if tid != 0
ccall(:jl_wakeup_thread, Cvoid, (Int16,), (tid - 1) % Int16)
end
return t
end

Expand Down
5 changes: 5 additions & 0 deletions src/partr.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ static int sleep_check_after_threshold(uint64_t *start_cycles)
*/
if (jl_running_under_rr(0))
return 1;
return 0;
/* nosleep
if (!(*start_cycles)) {
*start_cycles = jl_hrtime();
return 0;
Expand All @@ -251,6 +253,7 @@ static int sleep_check_after_threshold(uint64_t *start_cycles)
return 1;
}
return 0;
*/
}


Expand Down Expand Up @@ -318,11 +321,13 @@ JL_DLLEXPORT void jl_wakeup_thread(int16_t tid) JL_NOTSAFEPOINT
// in the future, we might want to instead wake some fraction of threads,
// and let each of those wake additional threads if they find work
int anysleep = 0;
/* nosleep
int nthreads = jl_atomic_load_acquire(&jl_n_threads);
for (tid = 0; tid < nthreads; tid++) {
if (tid != self)
anysleep |= wake_thread(tid);
}
*/
// check if we need to notify uv_run too
if (uvlock != ct && anysleep) {
jl_fence();
Expand Down