15void ThreadFunc(std::chrono::milliseconds duration) {
18 std::this_thread::sleep_for(duration);
22 using namespace numapp;
23 using namespace std::chrono_literals;
25 std::cout <<
"NUMA not available";
29 std::vector<std::thread> threads;
30 std::string name =
"thread-";
37 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.