MADNESS 0.10.1
Files | Namespaces | Classes | Functions
Collaboration diagram for Threads:

Files

file  thread.cc
 Implements Dqueue, Thread, ThreadBase and ThreadPool.
 
file  thread.h
 Implements Dqueue, Thread, ThreadBase and ThreadPool.
 
file  thread_info.h
 Implements thread introspection.
 

Namespaces

namespace  madness::profiling
 

Classes

class  madness::PoolTaskInterface
 Lowest level task interface. More...
 
class  madness::PoolTaskNull
 A no-operation task used for various purposes. More...
 
class  madness::TaskAttributes
 Contains attributes of a task. More...
 
class  madness::TaskThreadEnv
 Used to pass information about the thread environment to a user's task. More...
 
class  madness::Thread
 Simplified thread wrapper to hide pthread complexity. More...
 
class  madness::ThreadBase
 Simplified thread wrapper to hide pthread complexity. More...
 
class  madness::ThreadPool
 A singleton pool of threads for dynamic execution of tasks. More...
 
class  madness::ThreadPoolThread
 ThreadPool thread object. More...
 

Functions

void madness::threadpool_wait_policy (WaitPolicy policy, int sleep_duration_in_microseconds=0)
 

Detailed Description

Todo:
Write this section.

Function Documentation

◆ threadpool_wait_policy()

void madness::threadpool_wait_policy ( WaitPolicy  policy,
int  sleep_duration_in_microseconds = 0 
)
inline

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
policyspecifies 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_microsecondsif policy==WaitPolicy::Sleep this specifies the duration of sleep, in microseconds

References madness::ThreadPool::set_wait_policy().