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. 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. More...

#include <Affinity>

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)
 
void remove (unsigned int cpuNmber)
 
 operator bool () const
 

Public Attributes

ActiveCPUs activeCPUs
 

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

◆ Affinity() [3/4]

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

◆ 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.

◆ operator bool()

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

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

◆ operator=()

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

◆ remove()

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

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

Member Data Documentation

◆ activeCPUs

ActiveCPUs OpenThreads::Affinity::activeCPUs

Set of CPUs that a thread should have affinity to.


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