Deals with xambug #14644 and similar issues.
thread = mono_thread_internal_current ();
ves_icall_System_Threading_Thread_SetName_internal (thread, mono_string_new (mono_domain_get (), "Threadpool monitor"));
while (1) {
- ms = 500;
+ ms = 2000;
i = 10; //number of spurious awakes we tolerate before doing a round of rebalancing.
do {
guint32 ts;
{
if (tp->waiting)
MONO_SEM_POST (&tp->new_job);
+ threadpool_start_thread (tp);
}
void
mono_cq_enqueue (tp->queue, ar);
}
- for (i = 0; tp->waiting > 0 && i < MIN(njobs, tp->max_threads); i++)
+ for (i = 0; i < MIN(njobs, tp->max_threads); i++)
pulse_on_new_job (tp);
}