Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't suspend schedulers if terminating and reset steal_attempts on wake #2447

Merged
merged 1 commit into from
Dec 25, 2017
Merged
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
10 changes: 8 additions & 2 deletions src/libponyrt/sched/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,11 @@ static pony_actor_t* steal(scheduler_t* sched)
{
// if we're the highest active scheduler thread
// and there are more active schedulers than the minimum requested
// and we're not terminating
if ((sched == &scheduler[current_active_scheduler_count - 1])
&& (current_active_scheduler_count > min_scheduler_count) &&
!atomic_exchange_explicit(&scheduler_count_changing, true,
&& (current_active_scheduler_count > min_scheduler_count)
&& (!sched->terminate)
&& !atomic_exchange_explicit(&scheduler_count_changing, true,
memory_order_acquire))
{
// let sched 0 know we're suspending
Expand Down Expand Up @@ -457,6 +459,10 @@ static pony_actor_t* steal(scheduler_t* sched)

// dtrace resume notification
DTRACE1(THREAD_RESUME, (uintptr_t)sched);

// reset steal_attempts so we try to steal from all other schedulers
// prior to suspending again
steal_attempts = 0;
}
else if(!sched->asio_noisy)
{
Expand Down