JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
jevois::ThreadPool Class Reference

#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.
 

Constructor & Destructor Documentation

◆ ThreadPool()

jevois::ThreadPool::ThreadPool ( unsigned int  threads = std::thread::hardware_concurrency(),
bool  little = false 
)

Constructor.

Definition at line 33 of file ThreadPool.C.

References execute(), LERROR, and LINFO.

◆ ~ThreadPool()

jevois::ThreadPool::~ThreadPool ( )

Destructor.

Definition at line 106 of file ThreadPool.C.

Member Function Documentation

◆ execute()

template<typename Func , typename... Args, std::enable_if_t< std::is_invocable_v< Func &&, Args &&... >, bool > = true>
auto jevois::ThreadPool::execute ( Func &&  func,
Args &&...  args 
) -> std::future< decltype(func(args...))>

Execute a function and get a future.

Referenced by ThreadPool().

◆ getPoolSize()

auto jevois::ThreadPool::getPoolSize ( ) -> size_t

Get the pool size.

Definition at line 118 of file ThreadPool.C.


The documentation for this class was generated from the following files: