|
DIE Engine
|
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 |
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
| 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 | ( | ) |
| void WorkerPool::enqueue | ( | std::function< void()> | job | ) |
Add a job to the pool (jobs may run in any order).
| void WorkerPool::waitAll | ( | ) |
Block until all enqueued jobs have completed.
|
inline |
Number of worker threads in the pool.
|
staticconstexpr |