Describes the affinity of an Action or Task to a worker thread of a Node.
More...
#include <affinity.h>
Describes the affinity of an Action or Task to a worker thread of a Node.
embb::mtapi::Affinity::Affinity |
( |
| ) |
|
Constructs an Affinity object.
- Concurrency
- Not thread-safe
embb::mtapi::Affinity::Affinity |
( |
Affinity const & |
other | ) |
|
Copies an Affinity object.
- Concurrency
- Thread-safe and wait-free
- Parameters
-
embb::mtapi::Affinity::Affinity |
( |
bool |
initial_affinity | ) |
|
Constructs an Affinity object with the given initial affinity.
If initial_affinity
is true
the Affinity will map to all worker threads, otherwise it will map to no worker threads.
- Concurrency
- Not thread-safe
- Parameters
-
initial_affinity | The initial affinity to set. |
void embb::mtapi::Affinity::operator= |
( |
Affinity const & |
other | ) |
|
Copies an Affinity object.
- Concurrency
- Thread-safe and wait-free
- Parameters
-
void embb::mtapi::Affinity::Init |
( |
bool |
initial_affinity | ) |
|
Initializes an Affinity object with the given initial affinity.
If initial_affinity
is true
the Affinity will map to all worker threads, otherwise it will map to no worker threads.
- Concurrency
- Not thread-safe
- Parameters
-
initial_affinity | The initial affinity to set. |
void embb::mtapi::Affinity::Set |
( |
mtapi_uint_t |
worker, |
|
|
bool |
state |
|
) |
| |
Sets affinity to the given worker.
- Concurrency
- Not thread-safe
- Parameters
-
worker | The worker to set affinity to. |
state | The state of the affinity. |
bool embb::mtapi::Affinity::Get |
( |
mtapi_uint_t |
worker | ) |
|
Gets affinity to the given worker.
- Returns
true
, if the Affinity maps to the worker, false
otherwise.
- Concurrency
- Thread-safe and wait-free
- Parameters
-
worker | The worker to get affinity of. |
Returns the internal representation of this object.
Allows for interoperability with the C interface.
- Returns
- The internal mtapi_affinity_t.
- Concurrency
- Thread-safe and wait-free