1 #ifndef WORKER_POOL_HPP
2 #define WORKER_POOL_HPP
4 #include <condition_variable>
48 std::vector<std::thread> _workers;
49 std::queue<std::function<void()>> _jobs;
51 std::condition_variable _cv;
74 void addJob(
const std::function<
void()>& jobToExecute);
Interface for defining jobs to be executed by the worker pool. Classes implementing this interface mu...
Worker Pool for Concurrent Job Execution.
void addJob(const std::function< void()> &jobToExecute)
WorkerPool(const int &nbWorkers)