openscenegraph
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

Referenced by Affinity(), and operator=().

◆ 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

References activeCPUs, and Affinity().

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, and Affinity().

◆ 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(), Affinity(), Affinity(), operator bool(), operator=(), and remove().


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