From c12c2a5acec3cc2d7d1752b416c17b4df70f2a14 Mon Sep 17 00:00:00 2001 From: Dipin Hora Date: Sat, 25 Jun 2022 22:03:00 -0400 Subject: [PATCH] Revert "Make sure unmuted actors can't run on two schedulers concurrently" This reverts commit dbfbd9ac62084b43233a2a3ff661b90a08a3fc99. Reverting this because it's an incomplete fix and a proper fix will require larger changes. Will revisit later. --- src/libponyrt/sched/scheduler.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/libponyrt/sched/scheduler.c b/src/libponyrt/sched/scheduler.c index c98c9b7f77f..144895f6049 100644 --- a/src/libponyrt/sched/scheduler.c +++ b/src/libponyrt/sched/scheduler.c @@ -1488,23 +1488,10 @@ bool ponyint_sched_unmute_senders(pony_ctx_t* ctx, pony_actor_t* actor) { needs_unmuting = ponyint_actorstack_pop(needs_unmuting, &to_unmute); - // check if the actor has any messages waiting to be processed - // note: this must be done before the actor is unmuted to - // avoid a race condition - bool should_reschedule = !ponyint_messageq_isempty(&to_unmute->q); - - // unmute actor ponyint_unmute_actor(to_unmute); - - // only reschedule if the actor had messages waiting to be processed - // before we unnmuted it to ensure it cannot be concurrently - // scheduled on multiple scheduler threads - if(should_reschedule) - { - ponyint_sched_add(ctx, to_unmute); - DTRACE2(ACTOR_SCHEDULED, (uintptr_t)sched, (uintptr_t)to_unmute); - actors_rescheduled++; - } + ponyint_sched_add(ctx, to_unmute); + DTRACE2(ACTOR_SCHEDULED, (uintptr_t)sched, (uintptr_t)to_unmute); + actors_rescheduled++; ponyint_sched_start_global_unmute(ctx->scheduler->index, to_unmute); }