OnixS C++ CME MDP Conflated UDP Handler  1.1.2
API documentation
ThreadPool Class Reference

#include <OnixS/CME/ConflatedUDP/ThreadPool.h>

Public Member Functions

 ThreadPool (size_t capacity)
 
 ~ThreadPool ()
 
size_t size () const
 
size_t capacity () const
 
void start (Task &task)
 
ONIXS_CONFLATEDUDP_EXPORTED void start (Task &, const ThreadAffinity &)
 
ONIXS_CONFLATEDUDP_EXPORTED void joinAll ()
 

Detailed Description

Definition at line 116 of file ThreadPool.h.

Constructor & Destructor Documentation

ThreadPool ( size_t  capacity)
inlineexplicit

Initializes the pool of the requested capacity.

Definition at line 136 of file ThreadPool.h.

~ThreadPool ( )
inline

Finalizes the instance.

Waits until all threads accomplish their tasks.

Definition at line 146 of file ThreadPool.h.

Member Function Documentation

size_t capacity ( ) const
inline

Maximal number of threads maintained by the given pool.

Definition at line 159 of file ThreadPool.h.

ONIXS_CONFLATEDUDP_EXPORTED void joinAll ( )

Blocks until all threads accomplish their tasks.

size_t size ( ) const
inline

Number of active threads currently busy executing user-defined tasks.

Definition at line 153 of file ThreadPool.h.

void start ( Task task)
inline

Spawns the new thread executing the given task.

Raises exception if the number of active threads exceeds the predefined capacity of the pool.

Definition at line 169 of file ThreadPool.h.

ONIXS_CONFLATEDUDP_EXPORTED void start ( Task ,
const ThreadAffinity  
)

Spawns the new thread executing the given task. Binds the spawned thread to the defined set of cores/processors.

Raises exception if the number of active threads exceeds the predefined capacity of the pool.


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