Darwin Neuroevolution Framework
|
A basic thread pool (managing a fixed number of threads) More...
#include <thread_pool.h>
Public Member Functions | |
ThreadPool (int threads_count, Controller *controller=nullptr) | |
Creates a new thread pool. More... | |
void | processBatch (unique_ptr< WorkBatch > batch) |
Queues the work items in the specified batch and waits for completition. More... | |
int | threadsCount () const |
The number of threads managed by this thread pool. | |
Static Public Attributes | |
static constexpr int | kAutoThreadCount = 0 |
Automatic thread count, based on the detected number of cores. | |
A basic thread pool (managing a fixed number of threads)
pp::ThreadPool::ThreadPool | ( | int | threads_count, |
Controller * | controller = nullptr |
||
) |
Creates a new thread pool.
threads_count | - the count of threads, or kAutoThreadCount |
controller | - an optional thread pool controller |
void pp::ThreadPool::processBatch | ( | unique_ptr< WorkBatch > | batch | ) |
Queues the work items in the specified batch and waits for completition.