14 Example(std::chrono::milliseconds duration) : m_duration(duration) {
16 Example(Example&&) =
default;
19 std::cout <<
"Thread affinity: "
22 std::this_thread::sleep_for(m_duration);
24 std::chrono::milliseconds m_duration;
28 using namespace numapp;
29 using namespace std::chrono_literals;
31 std::cout <<
"NUMA not available";
38 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.