3#include <numapp/numa.hpp>
7 Example(std::chrono::milliseconds duration) : m_duration(duration) {
9 Example(Example&&) =
default;
12 std::cout <<
"Thread affinity: "
15 std::this_thread::sleep_for(m_duration);
17 std::chrono::milliseconds m_duration;
22 using namespace std::chrono_literals;
24 std::cout <<
"NUMA not available";
31 MakeJthread(
"myThread", policies, &Example::ThreadFunc, Example{500ms});
static CpuAffinity MakeFromCpuStringAll(char const *cpustring)
Create CpuAffinity from `cpustring` without considering current cpuset.
static CpuAffinity MakeFromActive()
Create current affinity settings.
Combines the the available NUMA policy types in one object.
void SetCpuAffinity(std::optional< CpuAffinity > affinity) noexcept
Set CPU affinity.
bool NumaAvailable() noexcept
Query whether system has NUMA support.
Contains declarations for numapp thread utilities.