Cambridge SMT System
ucam::util::TrivialThreadPool Class Reference

Trivial implementation of a threadpool based on boost::asio methods When initiated, creates a threadpool of n threads (n <= number of cpus). Jobs should be submitted with the templated operator(). When the object is deleted it will wait for all threads to finish. More...

#include <multithreading.hpp>

Public Member Functions

 TrivialThreadPool (std::size_t n)
 
 ~TrivialThreadPool ()
 
template<typename F >
void operator() (F task)
 

Detailed Description

Trivial implementation of a threadpool based on boost::asio methods When initiated, creates a threadpool of n threads (n <= number of cpus). Jobs should be submitted with the templated operator(). When the object is deleted it will wait for all threads to finish.

Definition at line 33 of file multithreading.hpp.

Constructor & Destructor Documentation

ucam::util::TrivialThreadPool::TrivialThreadPool ( std::size_t  n)
inline

Definition at line 42 of file multithreading.hpp.

Here is the call graph for this function:

ucam::util::TrivialThreadPool::~TrivialThreadPool ( )
inline

Definition at line 55 of file multithreading.hpp.

Member Function Documentation

template<typename F >
void ucam::util::TrivialThreadPool::operator() ( F  task)
inline

Definition at line 61 of file multithreading.hpp.


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