Class implementing a thread pool to deal with multi thread KDTree building process.
More...
|
| KDTreeFactoryThreadPool (std::size_t const _pool_size) |
| KDTree factory thread pool constructor. More...
|
|
| KDTreeFactoryThreadPool () |
| KDTree factory thread pool constructor which uses concurrent threads supported by the system as the default pool size. More...
|
|
| MDThreadPool (std::size_t const _pool_size) |
| Multiple data thread pool constructor. More...
|
|
void | run_md_task (Task task, KDTreeBuildType *data) |
| Run a task with associated data without considering limit for max pending tasks.
|
|
bool | try_run_md_task (Task task, KDTreeBuildType *data) |
| Try to run a task with associated data. If the max limit of pending tasks has not been reached, the task will be run asynchronously and true will be returned once it has been posted to the asynchronous execution service. If the max limit has been reached, then the task will not be posted to the asynchronous execution service and false will be returned. More...
|
|
void | join () override |
| Lock until all pending threads have finished.
|
|
virtual size_t | getPendingTasks () |
| Obtain the number of pending tasks to be computed. More...
|
|
virtual size_t | safeGetPendingTasks () |
| Obtain the number of pending tasks to be computed in a thread safe way. It is, with proper handling of concurrent reading. More...
|
|
virtual void | setPendingTasks (size_t const pendingTasks) |
| Set the number of pending tasks to be computed. More...
|
|
virtual void | safeSetPendingTasks (size_t const pendingTasks) |
| Set the number of pending tasks to be computed in a thread safe way. It is, with proper handling of current writting. More...
|
|
virtual void | subtractPendingTasks (size_t const amount) |
| Subtract specified amount of pending tasks. More...
|
|
virtual void | safeSubtractPendingTasks (size_t const amount) |
| Subtract pending tasks in a thread safe way. It is, with proper handling of concurrency. More...
|
|
virtual void | increasePendingTasks () |
| Unitary increase the number of pending tasks to be computed.
|
|
virtual void | decreasePendingTasks () |
| Unitary decrease the number of pending tasks to be computed.
|
|
| 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...
|
|
|
void | do_md_task (boost::function< void(KDTreeNode *, bool const, vector< Primitive * > &, int const, int const)> &task, KDTreeBuildType *data) override |
| Do a recursive build of KDTree node task. More...
|
|
virtual void | wrap_md_task (boost::function< void(TaskArgs ...)> &task, KDTreeBuildType *data) |
| Wrap a data task so that pending tasks count can be increased once provided data task has been completed. More...
|
|
void | do_task (boost::function< void(TaskArgs ...)> &task) override |
| Throw exception when calling non data do_task. More...
|
|
virtual void | do_md_task (boost::function< void(TaskArgs ...)> &task, KDTreeBuildType *data)=0 |
| Invoke task with associated data. 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::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 multi thread KDTree building process.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
- See also
- ThreadPool
-
MDThreadPool
-
MultiThreadKDTreeFactory
-
KDTreeBuildType