ThreadPoolKeepAwake#

class ThreadPoolKeepAwake#

Hold a reference on the JIT thread pool’s keep-awake count for the lifetime of this object, so that back-to-back small parallel loops don’t pay to wake up the pool’s threads.

Instances may be nested, and may live on different threads. Idle threads keep their cores busy while any instance is alive, so hold one only around phases that run many short parallel loops. See halide_thread_pool_keep_awake in HalideRuntime.h for details. This is the JIT equivalent of Halide::Runtime::ThreadPoolKeepAwake, which is for AOT code. See also Internal::JITSharedRuntime::thread_pool_keep_awake.