ThreadSchedule 4.1.0
Modern C++ thread management library
Loading...
Searching...
No Matches
posix.hpp File Reference

POSIX and Linux native thread-control implementation fragment. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

auto pthread_call_result (int result) -> expected< void, std::error_code >
template<typename SetSchedFn>
auto apply_sched_params (native_scheduling_policy policy, native_thread_priority priority, SetSchedFn &&set_sched) -> expected< void, std::error_code >
auto apply_scheduling_policy (pthread_t handle, native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code >
auto apply_affinity (pthread_t handle, native_thread_affinity const &affinity) -> expected< void, std::error_code >
auto apply_name (pthread_t handle, std::string const &name) -> expected< void, std::error_code >
auto read_name (pthread_t handle) -> expected< std::string, std::error_code >
auto read_affinity (pthread_t handle) -> expected< native_thread_affinity, std::error_code >
auto read_priority (pthread_t handle) -> std::optional< int >
auto read_scheduling_policy (pthread_t handle) -> std::optional< native_scheduling_policy >
auto apply_scheduling_policy (pid_t tid, native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code >
auto apply_nice_value (pid_t tid, int nice_value) -> expected< void, std::error_code >
auto apply_affinity (pid_t tid, native_thread_affinity const &affinity) -> expected< void, std::error_code >
auto apply_name (pid_t tid, std::string const &name) -> expected< void, std::error_code >
auto read_name (pid_t tid) -> expected< std::string, std::error_code >
auto read_affinity (pid_t tid) -> expected< native_thread_affinity, std::error_code >
auto read_priority (pid_t tid) -> std::optional< int >
auto read_nice_value (pid_t tid) -> expected< int, std::error_code >
auto read_scheduling_policy (pid_t tid) -> std::optional< native_scheduling_policy >

Detailed Description

POSIX and Linux native thread-control implementation fragment.

Included by native.hpp inside threadschedule::detail after the shared native scheduling value types have been declared.

Definition in file posix.hpp.

Function Documentation

◆ apply_affinity() [1/2]

auto apply_affinity ( pid_t tid,
native_thread_affinity const & affinity )->expected< void, std::error_code >
inline

Definition at line 137 of file posix.hpp.

◆ apply_affinity() [2/2]

auto apply_affinity ( pthread_t handle,
native_thread_affinity const & affinity )->expected< void, std::error_code >
inline

Definition at line 50 of file posix.hpp.

References pthread_call_result().

◆ apply_name() [1/2]

auto apply_name ( pid_t tid,
std::string const & name )->expected< void, std::error_code >
inline

Definition at line 145 of file posix.hpp.

◆ apply_name() [2/2]

auto apply_name ( pthread_t handle,
std::string const & name )->expected< void, std::error_code >
inline

Definition at line 57 of file posix.hpp.

◆ apply_nice_value()

auto apply_nice_value ( pid_t tid,
int nice_value )->expected< void, std::error_code >
inline

Definition at line 125 of file posix.hpp.

◆ apply_sched_params()

template<typename SetSchedFn>
auto apply_sched_params ( native_scheduling_policy policy,
native_thread_priority priority,
SetSchedFn && set_sched )->expected< void, std::error_code >
inline

Definition at line 23 of file posix.hpp.

Referenced by apply_scheduling_policy().

◆ apply_scheduling_policy() [1/2]

auto apply_scheduling_policy ( pid_t tid,
native_scheduling_policy policy,
native_thread_priority priority )->expected< void, std::error_code >
inline

Definition at line 118 of file posix.hpp.

References apply_sched_params().

◆ apply_scheduling_policy() [2/2]

auto apply_scheduling_policy ( pthread_t handle,
native_scheduling_policy policy,
native_thread_priority priority )->expected< void, std::error_code >
inline

Definition at line 38 of file posix.hpp.

References pthread_call_result().

◆ pthread_call_result()

auto pthread_call_result ( int result) ->expected< void, std::error_code >
inline

Definition at line 14 of file posix.hpp.

Referenced by apply_affinity(), and apply_scheduling_policy().

◆ read_affinity() [1/2]

auto read_affinity ( pid_t tid) ->expected< native_thread_affinity, std::error_code >
inline

Definition at line 180 of file posix.hpp.

◆ read_affinity() [2/2]

auto read_affinity ( pthread_t handle) ->expected< native_thread_affinity, std::error_code >
inline

Definition at line 78 of file posix.hpp.

◆ read_name() [1/2]

auto read_name ( pid_t tid) ->expected< std::string, std::error_code >
inline

Definition at line 163 of file posix.hpp.

◆ read_name() [2/2]

auto read_name ( pthread_t handle) ->expected< std::string, std::error_code >
inline

Definition at line 68 of file posix.hpp.

◆ read_nice_value()

auto read_nice_value ( pid_t tid) ->expected< int, std::error_code >
inline

Definition at line 206 of file posix.hpp.

◆ read_priority() [1/2]

auto read_priority ( pid_t tid) ->std::optional< int >
inline

Definition at line 197 of file posix.hpp.

◆ read_priority() [2/2]

auto read_priority ( pthread_t handle) ->std::optional< int >
inline

Definition at line 96 of file posix.hpp.

◆ read_scheduling_policy() [1/2]

auto read_scheduling_policy ( pid_t tid) ->std::optional< native_scheduling_policy >
inline

Definition at line 218 of file posix.hpp.

◆ read_scheduling_policy() [2/2]

auto read_scheduling_policy ( pthread_t handle) ->std::optional< native_scheduling_policy >
inline

Definition at line 106 of file posix.hpp.