DIE Engine
Loading...
Searching...
No Matches
WorkerPool Class Reference

Fixed pool of reusable worker threads. More...

#include <workerpool.h>

Public Member Functions

 WorkerPool ()
 ~WorkerPool ()
void enqueue (std::function< void()> job)
 Add a job to the pool (jobs may run in any order).
void waitAll ()
 Block until all enqueued jobs have completed.
int workerCount () const
 Number of worker threads in the pool.

Static Public Attributes

static constexpr unsigned WorkersMax = 8

Detailed Description

Fixed pool of reusable worker threads.

DIE ENGINE Depth Integration Engine / A modern ray-caster (c) Fred's Lab 2024-2026 Frédéric Meslin / info@.nosp@m.fred.nosp@m.slab..nosp@m.net SPDX-License-Identifier: MIT If used commercially, contributions, donations are highly appreciated.

pool of reusable threads

Constructor & Destructor Documentation

◆ WorkerPool()

WorkerPool::WorkerPool ( )

DIE ENGINE Depth Integration Engine / A modern ray-caster (c) Fred's Lab 2024-2026 Frédéric Meslin / info@.nosp@m.fred.nosp@m.slab..nosp@m.net SPDX-License-Identifier: MIT If used commercially, contributions, donations are highly appreciated.

pool of reusable threads

◆ ~WorkerPool()

WorkerPool::~WorkerPool ( )

Member Function Documentation

◆ enqueue()

void WorkerPool::enqueue ( std::function< void()> job)

Add a job to the pool (jobs may run in any order).

◆ waitAll()

void WorkerPool::waitAll ( )

Block until all enqueued jobs have completed.

◆ workerCount()

int WorkerPool::workerCount ( ) const
inline

Number of worker threads in the pool.

Member Data Documentation

◆ WorkersMax

unsigned WorkerPool::WorkersMax = 8
staticconstexpr

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