|
ThreadSchedule 4.1.0
Modern C++ thread management library
|
#include <thread_affinity.hpp>
Public Member Functions | |
| thread_affinity ()=default | |
| Construct an empty affinity set (no CPU pinning requested). | |
| thread_affinity (std::vector< cpu_id > cpus) | |
| Construct from a list of CPUs. | |
| thread_affinity (std::initializer_list< cpu_id > cpus) | |
| Construct from an initializer list of CPUs. | |
| void | add_cpu (cpu_id cpu) |
| Add a CPU to the affinity set. | |
| void | remove_cpu (cpu_id cpu) |
| Remove a CPU from the affinity set. | |
| void | clear () noexcept |
| Remove all CPUs from the affinity set. | |
| auto | contains (cpu_id cpu) const noexcept -> bool |
| Check whether a CPU is present in the affinity set. | |
| auto | empty () const noexcept -> bool |
| Return whether the affinity set is empty. | |
| auto | cpus () const noexcept THREADSCHEDULE_LIFETIMEBOUND -> std::vector< cpu_id > const & |
| Return the normalized sorted list of CPUs in the set. | |
Definition at line 19 of file thread_affinity.hpp.
|
default |
Construct an empty affinity set (no CPU pinning requested).
|
inlineexplicit |
Construct from a list of CPUs.
| cpus | CPU identifiers; duplicates are removed and values are sorted. |
Definition at line 28 of file thread_affinity.hpp.
References cpus().
|
inline |
Construct from an initializer list of CPUs.
| cpus | CPU identifiers; duplicates are removed and values are sorted. |
Definition at line 37 of file thread_affinity.hpp.
References cpus().
|
inline |
Add a CPU to the affinity set.
| cpu | CPU to add. |
Definition at line 47 of file thread_affinity.hpp.
References contains().
Referenced by threadschedule::advanced::affinity_for_node().
|
inlinenoexcept |
Remove all CPUs from the affinity set.
Definition at line 67 of file thread_affinity.hpp.
|
inlinenodiscardnoexcept |
Check whether a CPU is present in the affinity set.
| cpu | CPU identifier to test. |
Definition at line 77 of file thread_affinity.hpp.
Referenced by add_cpu().
|
inlinenodiscardnoexcept |
Return the normalized sorted list of CPUs in the set.
Definition at line 91 of file thread_affinity.hpp.
References THREADSCHEDULE_LIFETIMEBOUND.
Referenced by thread_affinity(), and thread_affinity().
|
inlinenodiscardnoexcept |
Return whether the affinity set is empty.
Definition at line 84 of file thread_affinity.hpp.
|
inline |
Remove a CPU from the affinity set.
| cpu | CPU to remove. |
Definition at line 60 of file thread_affinity.hpp.