Controls how aggressively ThreadPool holds on to the OS threads while waiting for work. Currently useful only for Pthread pool when it's using spinlocks; NOT used for TBB or PaRSEC.
- Parameters
-
policy | specifies how to wait for work;
- WaitPolicy::Busy – threads are kept busy (default); recommended when intensive work is only performed by MADNESS threads
- WaitPolicy::Yield – thread yields; recommended when intensive work is performed primarily by non-MADNESS threads
- WaitPolicy::Sleep – thread sleeps for
sleep_duration_in_microseconds ; recommended when intensive work is performed by MADNESS nd non-MADNESS threads
|
sleep_duration_in_microseconds | if policy==WaitPolicy::Sleep this specifies the duration of sleep, in microseconds |
References madness::ThreadPool::set_wait_policy().