|
JeVois
1.23
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Util/ThreadPool.H>
A thread pool with CPU affinity.
Thread pool with extra settings to enforce that passed tasks run on some particular cores. Used by JeVois-Pro Platform to enforce that machine vision tasks run on big cores (ARM A73) while non-critical tasks run on slower little cores (ARM A53).
Definition at line 47 of file ThreadPool.H.
Public Member Functions | |
| ThreadPool (unsigned int threads=std::thread::hardware_concurrency(), bool little=false) | |
| Constructor. | |
| ~ThreadPool () | |
| Destructor. | |
| template<typename Func , typename... Args, std::enable_if_t< std::is_invocable_v< Func &&, Args &&... >, bool > = true> | |
| auto | execute (Func &&func, Args &&... args) -> std::future< decltype(func(args...))> |
| Execute a function and get a future. | |
| auto | getPoolSize () -> size_t |
| Get the pool size. | |
| jevois::ThreadPool::ThreadPool | ( | unsigned int | threads = std::thread::hardware_concurrency(), |
| bool | little = false |
||
| ) |
| jevois::ThreadPool::~ThreadPool | ( | ) |
Destructor.
Definition at line 106 of file ThreadPool.C.
| auto jevois::ThreadPool::execute | ( | Func && | func, |
| Args &&... | args | ||
| ) | -> std::future< decltype(func(args...))> |
Execute a function and get a future.
Referenced by ThreadPool().
| auto jevois::ThreadPool::getPoolSize | ( | ) | -> size_t |
Get the pool size.
Definition at line 118 of file ThreadPool.C.