RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk::componentFramework::DynamicThreadPool Class Reference

The DynamicThreadPool allows creating multiple threads which are garbage collected. More...

#include <dynamicThreadPool.hpp>

Public Member Functions

 DynamicThreadPool (std::string name, numapp::NumaPolicies policies={})
 Create a new DynamicThreadPool.
 
 DynamicThreadPool (const DynamicThreadPool &)=delete
 
 DynamicThreadPool (DynamicThreadPool &&)=delete
 
DynamicThreadPooloperator= (const DynamicThreadPool &)=delete
 
DynamicThreadPooloperator= (DynamicThreadPool &&)=delete
 
 ~DynamicThreadPool ()
 
template<class Func, class... Args>
void Submit (Func &&func, Args &&... args)
 Execute a function in a new thread which gets joined when it finishes or when the pool is destroyed.
 

Detailed Description

The DynamicThreadPool allows creating multiple threads which are garbage collected.

If the DynamicThreadPool is destroyed the remaining threads will be joined.

Thread Safety
thread-safe

Constructor & Destructor Documentation

◆ DynamicThreadPool() [1/3]

rtctk::componentFramework::DynamicThreadPool::DynamicThreadPool ( std::string name,
numapp::NumaPolicies policies = {} )
inlineexplicit

Create a new DynamicThreadPool.

Parameters
nameName to use for the threads.
policiesNUMA policies for the threads.

◆ DynamicThreadPool() [2/3]

rtctk::componentFramework::DynamicThreadPool::DynamicThreadPool ( const DynamicThreadPool & )
delete

◆ DynamicThreadPool() [3/3]

rtctk::componentFramework::DynamicThreadPool::DynamicThreadPool ( DynamicThreadPool && )
delete

◆ ~DynamicThreadPool()

rtctk::componentFramework::DynamicThreadPool::~DynamicThreadPool ( )
inline

Member Function Documentation

◆ operator=() [1/2]

DynamicThreadPool & rtctk::componentFramework::DynamicThreadPool::operator= ( const DynamicThreadPool & )
delete

◆ operator=() [2/2]

DynamicThreadPool & rtctk::componentFramework::DynamicThreadPool::operator= ( DynamicThreadPool && )
delete

◆ Submit()

template<class Func, class... Args>
void rtctk::componentFramework::DynamicThreadPool::Submit ( Func && func,
Args &&... args )
inline

Execute a function in a new thread which gets joined when it finishes or when the pool is destroyed.

Parameters
funcFunction to call.
argsArguments to the function.

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