Darwin Neuroevolution Framework
Public Member Functions | Static Public Attributes | List of all members
pp::ThreadPool Class Reference

A basic thread pool (managing a fixed number of threads) More...

#include <thread_pool.h>

Inheritance diagram for pp::ThreadPool:
core::NonCopyable

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.
 

Detailed Description

A basic thread pool (managing a fixed number of threads)

See also
WorkItem
WorkBatch
Controller

Constructor & Destructor Documentation

◆ ThreadPool()

pp::ThreadPool::ThreadPool ( int  threads_count,
Controller controller = nullptr 
)

Creates a new thread pool.

Parameters
threads_count- the count of threads, or kAutoThreadCount
controller- an optional thread pool controller

Member Function Documentation

◆ processBatch()

void pp::ThreadPool::processBatch ( unique_ptr< WorkBatch batch)

Queues the work items in the specified batch and waits for completition.

See also
WorkBatch

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