• Dridi Boukelmoune's avatar
    pool: Wait when we run out of workers · 68727334
    Dridi Boukelmoune authored
    Since the removal of dry signals, pools will spin when they run out of
    threads and increment MAIN.threads_limited at a very high rate. That
    spike in CPU consumption will also have detrimental effects on useful
    tasks.
    
    This change introduces a 1s delay when the pool is saturated. This
    allows to periodically exercise the watchdog check. We could wait until
    the watchdog times out but we would also miss potential updates to the
    thread_pool_watchdog parameter.
    
    To avoid spurious increments of MAIN.threads_limited we only take task
    submissions into account and ignore timeouts of the condvar.
    
    Refs #2942
    Refs #3531
    68727334
cache_wrk.c 18.2 KB