Skip to content

Commit

Permalink
disable scheduler scaling until all threads are created
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinhora committed Dec 4, 2024
1 parent a71a1fa commit 8d32e15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libponyrt/sched/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,9 @@ bool ponyint_sched_start(bool library)

atomic_store_explicit(&detect_quiescence, !library, memory_order_relaxed);

// disable dynamic scheduler scaling for startup until all threads are created
atomic_store_explicit(&temporarily_disable_scheduler_scaling, true, memory_order_relaxed);

DTRACE0(RT_START);
uint32_t start = 0;

Expand All @@ -1341,6 +1344,9 @@ bool ponyint_sched_start(bool library)
return false;
}

// enable dynamic scheduler scaling after all threads have been created
atomic_store_explicit(&temporarily_disable_scheduler_scaling, false, memory_order_relaxed);

#if defined(USE_SYSTEMATIC_TESTING)
// start processing
SYSTEMATIC_TESTING_START(scheduler, ponyint_asio_get_backend_tid(), ponyint_asio_get_backend_sleep_object());
Expand Down

0 comments on commit 8d32e15

Please # to comment.