|
pid
|
realtime library eases to monitor and control the execution of real-time threads. More...
Files | |
| file | real_time.h |
| header for the the real time library | |
Classes | |
| class | pid::MemoryLocker |
| Avoids the process memory to be swapped out as long as the object is alive. More... | |
| class | pid::CurrentThreadElapsedCPUTime |
| Counts real time spent by current thread on a CPU. More... | |
Enumerations | |
| enum | pid::NormalSchedulingPolicy { pid::NormalSchedulingPolicy::Other, pid::NormalSchedulingPolicy::Idle, pid::NormalSchedulingPolicy::Batch } |
| Available non realtime sheduling policy. More... | |
| enum | pid::RealTimeSchedulingPolicy { pid::RealTimeSchedulingPolicy::FIFO, pid::RealTimeSchedulingPolicy::RoundRobin } |
| Available realtime sheduling policy. More... | |
Functions | |
| void | pid::set_thread_affinity (std::thread &thread, int cpu) |
| Forces a thread to be executed on the given CPU/core. More... | |
| void | pid::setThreadAffinity (std::thread &thread, int cpu) |
| Forces a thread to be executed on the given CPU/core. More... | |
| void | pid::set_thread_affinity (std::thread::native_handle_type thread, int cpu) |
| Forces a thread to be executed on the given CPU/core. More... | |
| void | pid::setThreadAffinity (std::thread::native_handle_type thread, int cpu) |
| Forces a thread to be executed on the given CPU/core. More... | |
| void | pid::set_current_thread_affinity (int cpu) |
| Forces the current thread to be executed on the given CPU/core. More... | |
| void | pid::setCurrentThreadAffinity (int cpu) |
| Forces the current thread to be executed on the given CPU/core. More... | |
| void | pid::set_thread_scheduler (std::thread &thread, NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for current thread. More... | |
| void | pid::setThreadScheduler (std::thread &thread, NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for current thread. More... | |
| void | pid::set_thread_scheduler (std::thread::native_handle_type thread, NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for a given thread. More... | |
| void | pid::setThreadScheduler (std::thread::native_handle_type thread, NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for a given thread. More... | |
| void | pid::set_current_thread_scheduler (NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for the current thread. More... | |
| void | pid::setCurrentThreadScheduler (NormalSchedulingPolicy policy) |
| Sets a non-realtime scheduling policy for the current thread. More... | |
| void | pid::set_thread_scheduler (std::thread &thread, RealTimeSchedulingPolicy policy, int priority) |
| Sets a realtime scheduling policy for a given thread. More... | |
| void | pid::setThreadScheduler (std::thread &thread, RealTimeSchedulingPolicy policy, int priority) |
| Sets a realtime scheduling policy for a given thread. More... | |
| void | pid::set_thread_scheduler (std::thread::native_handle_type thread, RealTimeSchedulingPolicy policy, int priority) |
| Sets a realtime scheduling policy for a given thread. More... | |
| void | pid::setThreadScheduler (std::thread::native_handle_type thread, RealTimeSchedulingPolicy policy, int priority) |
| Sets a realtime scheduling policy for a given thread. More... | |
| void | pid::set_current_thread_scheduler (RealTimeSchedulingPolicy policy, int priority) |
| Sets a realtime scheduling policy for the current thread. More... | |
| std::shared_ptr< MemoryLocker > | pid::make_thread_real_time (std::thread &thread, int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the given thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler. More... | |
| std::shared_ptr< MemoryLocker > | pid::makeThreadRealTime (std::thread &thread, int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the given thread to make it real time. More... | |
| std::shared_ptr< MemoryLocker > | pid::make_thread_real_time (std::thread::native_handle_type thread, int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the given thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler. More... | |
| std::shared_ptr< MemoryLocker > | pid::makeThreadRealTime (std::thread::native_handle_type thread, int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the given thread to make it real time. More... | |
| std::shared_ptr< MemoryLocker > | pid::make_current_thread_real_time (int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the current thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler. More... | |
| std::shared_ptr< MemoryLocker > | pid::makeCurrentThreadRealTime (int priority=90, int cpu_idx=-1) |
| Sets some default parameters to the current thread to make it real time. More... | |
realtime library eases to monitor and control the execution of real-time threads.
General functionalities provided are:
|
strong |
|
strong |
| std::shared_ptr<MemoryLocker> pid::make_current_thread_real_time | ( | int | priority = 90, |
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the current thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler.
The scheduling policy is RealTimeSchedulingPolicy::FIFO. At each function call a new CPU is used to pin the thread to, unless all CPUs have been used already and it that case it starts again from the first one. The MemoryLocker is default-created.
| priority | (optional) the priority to give to the thread, in the 1-99 range |
| cpu_idx | (optional) the index of the cpu the thread will execute on |
| std::shared_ptr<MemoryLocker> pid::make_thread_real_time | ( | std::thread & | thread, |
| int | priority = 90, |
||
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the given thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler.
The scheduling policy is RealTimeSchedulingPolicy::FIFO. At each function call a new CPU is used to pin the thread to, unless all CPUs have been used already and it that case it starts again from the first one. The MemoryLocker is default-created.
| thread | the thread that requires real time capabilities |
| priority | (optional) the priority to give to the thread, in the 1-99 range |
| cpu_idx | (optional) the index of the cpu the thread will execute on |
| std::shared_ptr<MemoryLocker> pid::make_thread_real_time | ( | std::thread::native_handle_type | thread, |
| int | priority = 90, |
||
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the given thread to make it real time. For a finer control, please use setThreadAffinity and setThreadScheduler.
The scheduling policy is RealTimeSchedulingPolicy::FIFO. At each function call a new CPU is used to pin the thread to, unless all CPUs have been used already and it that case it starts again from the first one. The MemoryLocker is default-created.
| thread | the thread that requires real time capabilities |
| priority | (optional) the priority to give to the thread, in the 1-99 range |
| cpu_idx | (optional) the index of the cpu the thread will execute on |
| std::shared_ptr<MemoryLocker> pid::makeCurrentThreadRealTime | ( | int | priority = 90, |
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the current thread to make it real time.
| std::shared_ptr<MemoryLocker> pid::makeThreadRealTime | ( | std::thread & | thread, |
| int | priority = 90, |
||
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the given thread to make it real time.
| std::shared_ptr<MemoryLocker> pid::makeThreadRealTime | ( | std::thread::native_handle_type | thread, |
| int | priority = 90, |
||
| int | cpu_idx = -1 |
||
| ) |
Sets some default parameters to the given thread to make it real time.
| void pid::set_current_thread_affinity | ( | int | cpu | ) |
Forces the current thread to be executed on the given CPU/core.
| cpu | the cpu to pin the thread to |
| void pid::set_current_thread_scheduler | ( | NormalSchedulingPolicy | policy | ) |
Sets a non-realtime scheduling policy for the current thread.
| policy | the scheduling policy to use |
| void pid::set_current_thread_scheduler | ( | RealTimeSchedulingPolicy | policy, |
| int | priority | ||
| ) |
Sets a realtime scheduling policy for the current thread.
| policy | the scheduling policy to use |
| priority | the scheduling priority to use, in the 1-99 range |
| void pid::set_thread_affinity | ( | std::thread & | thread, |
| int | cpu | ||
| ) |
Forces a thread to be executed on the given CPU/core.
| thread | the thread to set the affinity to |
| cpu | the cpu to pin the thread to |
| void pid::set_thread_affinity | ( | std::thread::native_handle_type | thread, |
| int | cpu | ||
| ) |
Forces a thread to be executed on the given CPU/core.
| thread | the thread to set the affinity to |
| cpu | the cpu to pin the thread to |
| void pid::set_thread_scheduler | ( | std::thread & | thread, |
| NormalSchedulingPolicy | policy | ||
| ) |
Sets a non-realtime scheduling policy for current thread.
| thread | the thread to set the scheduling policy for |
| policy | the scheduling policy to use |
| void pid::set_thread_scheduler | ( | std::thread & | thread, |
| RealTimeSchedulingPolicy | policy, | ||
| int | priority | ||
| ) |
Sets a realtime scheduling policy for a given thread.
| thread | the thread to set the scheduling policy for |
| policy | the scheduling policy to use |
| priority | the scheduling priority to use, in the 1-99 range |
| void pid::set_thread_scheduler | ( | std::thread::native_handle_type | thread, |
| NormalSchedulingPolicy | policy | ||
| ) |
Sets a non-realtime scheduling policy for a given thread.
| thread | the thread to set the scheduling policy for |
| policy | the scheduling policy to use |
| void pid::set_thread_scheduler | ( | std::thread::native_handle_type | thread, |
| RealTimeSchedulingPolicy | policy, | ||
| int | priority | ||
| ) |
Sets a realtime scheduling policy for a given thread.
| thread | the thread to set the scheduling policy for |
| policy | the scheduling policy to use |
| priority | the scheduling priority to use, in the 1-99 range |
| void pid::setCurrentThreadAffinity | ( | int | cpu | ) |
Forces the current thread to be executed on the given CPU/core.
| void pid::setCurrentThreadScheduler | ( | NormalSchedulingPolicy | policy | ) |
Sets a non-realtime scheduling policy for the current thread.
| void pid::setThreadAffinity | ( | std::thread & | thread, |
| int | cpu | ||
| ) |
Forces a thread to be executed on the given CPU/core.
| void pid::setThreadAffinity | ( | std::thread::native_handle_type | thread, |
| int | cpu | ||
| ) |
Forces a thread to be executed on the given CPU/core.
| void pid::setThreadScheduler | ( | std::thread & | thread, |
| NormalSchedulingPolicy | policy | ||
| ) |
Sets a non-realtime scheduling policy for current thread.
| void pid::setThreadScheduler | ( | std::thread & | thread, |
| RealTimeSchedulingPolicy | policy, | ||
| int | priority | ||
| ) |
Sets a realtime scheduling policy for a given thread.
| void pid::setThreadScheduler | ( | std::thread::native_handle_type | thread, |
| NormalSchedulingPolicy | policy | ||
| ) |
Sets a non-realtime scheduling policy for a given thread.
| void pid::setThreadScheduler | ( | std::thread::native_handle_type | thread, |
| RealTimeSchedulingPolicy | policy, | ||
| int | priority | ||
| ) |
Sets a realtime scheduling policy for a given thread.
1.8.17