3#include "../result.hpp"
4#include "../scheduling.hpp"
5#include "../thread_affinity.hpp"
6#include "../thread_config.hpp"
13#include <system_error>
29[[nodiscard]]
inline auto
35[[nodiscard]]
inline auto
41[[nodiscard]]
inline auto
47[[nodiscard]]
inline auto
54namespace profile_detail
56[[nodiscard]]
inline auto
60 config.
set_name(std::move(name)).set_scheduling(profile.scheduling);
66template <
typename ThreadLike>
70 return value.configure(
make_config(profile, profile.name));
73template <
typename Pool>
77 return pool.configure_workers(
make_config(profile, std::move(name)));
81template <
typename ThreadLike>
106template <
typename ThreadLike>
110 std::vector<std::error_code> errors;
112 scheduling.
set_name(profile.name).set_scheduling(profile.scheduling);
113 auto configured = value.configure(scheduling);
114 errors.push_back(configured ? std::error_code{} : configured.error());
115 if (profile.affinity)
117 auto affinity = value.set_affinity(*profile.affinity);
118 errors.push_back(affinity ? std::error_code{} : affinity.error());
Strongly-typed realtime priority in the range $[1, 99]$.
Immutable scheduling request passed to thread creation/configuration APIs.
Portable thread configuration bundle.
auto set_name(std::string name) -> thread_config &
Set thread name.
auto set_affinity(thread_affinity affinity) -> thread_config &
Set CPU affinity mask.
auto make_config(thread_profile const &profile, std::string name) -> thread_config
auto apply_to_thread(ThreadLike &value, thread_profile const &profile) -> result< void >
auto apply_to_pool(Pool &pool, std::string name, thread_profile const &profile) -> result< void >
auto realtime() -> thread_profile
auto background() -> thread_profile
auto throughput() -> thread_profile
auto low_latency() -> thread_profile
auto apply_profile(ThreadLike &value, thread_profile const &profile) -> result< void >
auto apply_profile_detailed(ThreadLike &value, thread_profile const &profile) -> std::vector< std::error_code >
constexpr auto background() noexcept -> scheduling_config
Request background scheduling.
constexpr auto realtime_fifo(realtime_priority priority) noexcept -> scheduling_config
Request realtime FIFO scheduling.
constexpr auto normal() noexcept -> scheduling_config
Request default scheduling.
constexpr auto low_latency() noexcept -> scheduling_config
Request low-latency scheduling.
scheduling_config scheduling
std::optional< thread_affinity > affinity