NUMA++ 0.11.0
Loading...
Searching...
No Matches
schedulerExample2.cpp
1#include <iostream>
2#include <numapp/numa.hpp>
4
5int main() {
6 using namespace numapp;
7 if (!NumaAvailable()) {
8 std::cout << "NUMA not available";
9 return -1;
10 }
11
13
15 auto sched = current.GetScheduler<numapp::DynamicScheduler>();
16 std::cout << "Nice: " << sched.GetNice() << std::endl;
17 }
18
19 // Or get underlying variant
20 std::variant<DynamicScheduler, StaticScheduler, IdleScheduler> variant = current.Get();
21}
Normal non-realtime scheduler that use dynamic priority (nice value).
int GetNice() const noexcept
Get dynamic nice value.
A sum-type of all supported schedulers.
SchedulerVariant const & Get() const noexcept
Get the underlying scheduler.
static Scheduler MakeFromActive()
Return active scheduler policy for this thread.
constexpr T GetScheduler() const
Get the held scheduler.
constexpr bool HoldsScheduler() const noexcept
Query the held scheduler.
bool NumaAvailable() noexcept
Query whether system has NUMA support.
Definition numa.hpp:34
Contains scheduler declarations.