OpenSceneGraph
Public Types | Public Member Functions | Public Attributes | List of all members
OpenThreads::Affinity Class Reference

Simple container for specifying which CPU a thread should have affinity with. More...

Public Types

typedef std::set< unsigned int > ActiveCPUs
 

Public Member Functions

 Affinity ()
 
 Affinity (unsigned int cpuNumber)
 
 Affinity (unsigned int cpuNumber, unsigned int cpuCount)
 
 Affinity (const Affinity &rhs)
 
Affinityoperator= (const Affinity &rhs)
 
void add (unsigned int cpuNmber)
 add a specified cpu core from the list to have affinity to. More...
 
void remove (unsigned int cpuNmber)
 remove a specified cpu core from the list to have affinity to. More...
 
 operator bool () const
 return true if affinity has been provided for specific CPU cores. More...
 

Public Attributes

ActiveCPUs activeCPUs
 Set of CPUs that a thread should have affinity to. More...
 

Detailed Description

Simple container for specifying which CPU a thread should have affinity with.

An empty Affinity.activeCPUs/default constructed Affinity signifies that a thread should not have any specific affinity and be able to run on all available CPUs.

Member Typedef Documentation

◆ ActiveCPUs

typedef std::set<unsigned int> OpenThreads::Affinity::ActiveCPUs

Constructor & Destructor Documentation

◆ Affinity() [1/4]

OpenThreads::Affinity::Affinity ( )
inline

◆ Affinity() [2/4]

OpenThreads::Affinity::Affinity ( unsigned int  cpuNumber)
inline

References activeCPUs.

◆ Affinity() [3/4]

OpenThreads::Affinity::Affinity ( unsigned int  cpuNumber,
unsigned int  cpuCount 
)
inline

References activeCPUs.

◆ Affinity() [4/4]

OpenThreads::Affinity::Affinity ( const Affinity rhs)
inline

Member Function Documentation

◆ add()

void OpenThreads::Affinity::add ( unsigned int  cpuNmber)
inline

add a specified cpu core from the list to have affinity to.

References activeCPUs.

◆ operator bool()

OpenThreads::Affinity::operator bool ( ) const
inline

return true if affinity has been provided for specific CPU cores.

References activeCPUs.

◆ operator=()

Affinity& OpenThreads::Affinity::operator= ( const Affinity rhs)
inline

References activeCPUs.

◆ remove()

void OpenThreads::Affinity::remove ( unsigned int  cpuNmber)
inline

remove a specified cpu core from the list to have affinity to.

References activeCPUs.

Member Data Documentation

◆ activeCPUs

ActiveCPUs OpenThreads::Affinity::activeCPUs

Set of CPUs that a thread should have affinity to.

Referenced by add(), Affinity(), operator bool(), operator=(), and remove().


The documentation for this class was generated from the following file: