5#include <numapp/numa.hpp>
8void ThreadFunc(std::chrono::milliseconds duration) {
11 std::this_thread::sleep_for(duration);
16 using namespace std::chrono_literals;
18 std::cout <<
"NUMA not available";
22 std::vector<std::thread> threads;
23 std::string name =
"thread-";
30 for (
auto& thread : threads) {
static CpuAffinity MakeBindCpu(int cpu)
Create CpuAffinity bound to the specified CPU.
static CpuAffinity MakeFromActive()
Create current affinity settings.
static Cpumask MakeFromCpuStringAll(char const *cpustring)
Construct Cpumask from cpustring that does not consider current cpuset.
Contains declarations for CpumaskTrait.
bool NumaAvailable() noexcept
Query whether system has NUMA support.
void ForEach(Bitmask< Class > const &bitmask, F &&f, bool value=true)
Invoke function for each bit in mask that matches value.
std::thread MakeThread(std::string_view thread_name, NumaPolicies const &policies, Func &&func, Args &&... args)
Primary overload accepting string-view for thread_name.
Contains declarations for numapp thread utilities.