|
join 1.0
lightweight network framework library
|
wheel run policy spinning on a dedicated thread. More...
#include <wheel.hpp>
Public Member Functions | |
| SpinPolicy (int core=-1, int prio=0) noexcept | |
| create instance. | |
| SpinPolicy (const SpinPolicy &other)=delete | |
| copy constructor. | |
| SpinPolicy & | operator= (const SpinPolicy &other)=delete |
| copy assignment operator. | |
| SpinPolicy (SpinPolicy &&other)=delete | |
| move constructor. | |
| SpinPolicy & | operator= (SpinPolicy &&other)=delete |
| move assignment operator. | |
| ~SpinPolicy () noexcept | |
| destroy instance. | |
| template<class Wheel > | |
| int | start (Wheel &wheel, std::chrono::nanoseconds) |
| start spinning. | |
| void | stop () noexcept |
| stop spinning. | |
| bool | isRunnerThread () const noexcept |
| check if called from the spinning thread. | |
| template<class Wheel > | |
| int | flush (Wheel &) noexcept |
| no-op. | |
| int | affinity () const noexcept |
| get spinning thread affinity. | |
| int | priority () const noexcept |
| get spinning thread scheduling priority. | |
| pthread_t | handle () const noexcept |
| get the native handle of the spinning thread. | |
wheel run policy spinning on a dedicated thread.
|
inlineexplicitnoexcept |
create instance.
| core | thread core affinity (-1 no pinning). |
| prio | thread priority (0 = SCHED_OTHER, 1-99 = SCHED_FIFO). |
|
delete |
copy constructor.
| other | other object to copy. |
|
delete |
move constructor.
| other | other object to move. |
|
inlinenoexcept |
destroy instance.
|
inlinenoexcept |
get spinning thread affinity.
|
inlinenoexcept |
no-op.
| wheel | wheel to advance. |
|
inlinenoexcept |
get the native handle of the spinning thread.
|
inlinenoexcept |
check if called from the spinning thread.
|
delete |
copy assignment operator.
| other | other object to copy. |
|
delete |
move assignment operator.
| other | other object to move. |
|
inlinenoexcept |
get spinning thread scheduling priority.
|
inline |
start spinning.
| wheel | wheel to advance, shall outlive the run policy. |
| period | ignored, the loop never sleeps. |
| std::system_error | if the thread cannot be created. |
|
inlinenoexcept |
stop spinning.