NUMA++ 0.11.0
Loading...
Searching...
No Matches
schedulerExample1.cpp
1#include <iostream>
2#include <numapp/numa.hpp>
4
5int main() {
8 std::cout << "NUMA not available";
9 return -1;
10 }
11
12 auto policy = StaticScheduler(StaticScheduler::Policy::Fifo, 99);
13 // Set CPU affinity for main thread
14 if (auto ec = numapp::thisThread::Apply(policy); ec) {
15 std::cout << "Failed to apply policy: " << ec.message() << std::endl;
16 return 1;
17 }
18}
Static priority scheduler (real-time).
std::error_code Apply(CpuAffinity const &affinity) noexcept
Apply policy to calling thread.
bool NumaAvailable() noexcept
Query whether system has NUMA support.
Definition numa.hpp:34
Contains scheduler declarations.