Class implementing a thread pool to deal with pulse tasks.
More...
#include <PulseThreadPool.h>
|
| PulseThreadPool (std::size_t const _pool_size, double const deviceAccuracy, bool const dynamic) |
| Pulse thread pool constructor. More...
|
|
void | run_pulse_task (TaskDropper< PulseTask, PulseThreadPoolInterface, std::vector< std::vector< double >> &, RandomnessGenerator< double > &, RandomnessGenerator< double > &, NoiseSource< double > & > &dropper) override |
|
bool | try_run_pulse_task (TaskDropper< PulseTask, PulseThreadPoolInterface, std::vector< std::vector< double >> &, RandomnessGenerator< double > &, RandomnessGenerator< double > &, NoiseSource< double > & > &dropper) override |
|
void | join () override |
|
virtual bool | isDynamic () const |
| Check if the pulse thread pool is operating on dynamic mode (true) or not (false) More...
|
|
| ResThreadPool (std::size_t const _pool_size) |
| Resource thread pool constructor. More...
|
|
void | run_res_task (Task task) |
| Run a task with associated resources when there is an available thread for it.
|
|
bool | try_run_res_task (Task task) |
| Run a task with associated resources. If there is not even a single available thread, then return false so non-blocking behavior is possible. More...
|
|
| SimpleThreadPool (std::size_t const _pool_size) |
| Simple thread pool constructor. More...
|
|
void | run_task (Task task) |
| Run a task when there is an available thread for it.
|
|
virtual void | notifyOne () |
| Notify the conditional variable so if there is a waiting thread it will wake up.
|
|
| ThreadPool (std::size_t const _pool_size) |
| Thread pool constructor. More...
|
|
virtual std::size_t | getPoolSize () const |
| Obtain the thread pool size. More...
|
|
|
TimeWatcher | idleTimer |
| Time watcher to count the amount of idle time. More...
|
|
bool | dynamic |
| Specify whether the pulse thread pool uses a dynamic chunk size strategy (true) or a static one (false)
|
|
|
void | do_res_task (boost::function< void(std::vector< std::vector< double >> &, RandomnessGenerator< double > &, RandomnessGenerator< double > &, NoiseSource< double > &)> &task, int const resourceIdx) override |
| Do a pulse task. More...
|
|
void | wrap_res_task (boost::function< void(std::vector< std::vector< double >> &, RandomnessGenerator< double > &, RandomnessGenerator< double > &, NoiseSource< double > &)> &task, int const resourceIdx) override |
| Override task wrapping so when the full thread group is used the time at which first occupied thread becomes available is registered. More...
|
|
virtual int | getAvailableResourceSetIndex () const |
| Obtain the index of an available resource set. More...
|
|
virtual void | wrap_res_task (boost::function< void(TaskArgs ...)> &task, int const resourceIdx) |
| Wrap a task so that available threads count can be increased once provided task has been completed. More...
|
|
void | do_task (boost::function< void(TaskArgs ...)> &task) override |
| Throw exception when calling non resource do_task. More...
|
|
virtual void | do_res_task (boost::function< void(TaskArgs ...)> &task, int const resourceIdx)=0 |
| Invoke task with associated resources with corresponding arguments. More...
|
|
virtual void | wrap_task (boost::function< void(TaskArgs ...)> &task) |
| Wrap a task so that available threads count can be increased once provided task has been completed. More...
|
|
|
std::vector< std::vector< double > > * | apMatrices |
|
RandomnessGenerator< double > * | randGens |
| First randomness generators (general purpose), one per thread.
|
|
RandomnessGenerator< double > * | randGens2 |
| Second randomness generators (to substitute old box muller), one per thread.
|
|
UniformNoiseSource< double > * | intersectionHandlingNoiseSources |
| Intersection handling noise sources, one per thread.
|
|
bool * | resourceSetAvailable |
| Array of flags specifying availability of resource sets. More...
|
|
std::size_t | available_ |
| Number of available threads, those which are not currently performing a task.
|
|
boost::mutex | mutex_ |
| Mutex to handle concurrent tasks.
|
|
boost::condition_variable | cond_ |
| Condition variable to handle tasks dispatching depending on available threads.
|
|
boost::asio::io_service | io_service_ |
| Instance of boost input/output service for asynchronous data processing.
|
|
std::size_t | pool_size |
| Size of thread pool (number of threads)
|
|
boost::asio::io_service | io_service_ |
| Instance of boost input/output service for asynchronous data processing.
|
|
boost::asio::executor_work_guard< boost::asio::io_service::executor_type > | work_ |
| Instance of work guard to report the io service when it has pending tasks. More...
|
|
std::size_t | pool_size |
| Size of thread pool (number of threads)
|
|
boost::thread_group | threads_ |
| Group of threads.
|
|
Class implementing a thread pool to deal with pulse tasks.
- Version
- 1.0
- See also
- ResThreadPool
◆ PulseThreadPool()
PulseThreadPool::PulseThreadPool |
( |
std::size_t const |
_pool_size, |
|
|
double const |
deviceAccuracy, |
|
|
bool const |
dynamic |
|
) |
| |
|
inlineexplicit |
Pulse thread pool constructor.
- See also
- ThreadPool::pool_size
- Parameters
-
deviceAccuracy | Parameter used to handle randomness generation impact on simulation results |
◆ do_res_task()
◆ isDynamic()
virtual bool PulseThreadPool::isDynamic |
( |
| ) |
const |
|
inlinevirtual |
Check if the pulse thread pool is operating on dynamic mode (true) or not (false)
- Returns
- True if dynamic chunk scheduling, false if static
◆ join()
void PulseThreadPool::join |
( |
| ) |
|
|
inlineoverridevirtual |
◆ run_pulse_task()
◆ try_run_pulse_task()
◆ wrap_res_task()
Override task wrapping so when the full thread group is used the time at which first occupied thread becomes available is registered.
- See also
- PulseThreadPool::firstAvailableTime
◆ apMatrices
std::vector<std::vector<double> >* PulseThreadPool::apMatrices |
|
protected |
Alpha prime matrices for MarquardtFitter. One per possible thread, to avoid spamming reallocations
◆ idleTimer
The documentation for this class was generated from the following file: