5 #include <condition_variable>
18 ThreadPool(
int threadcount = 4,
int chunksize = 100);
22 void map(std::function<
void(T&)>
function, std::vector<T>& data);
24 void map(std::function<
void(T&)>
function, std::vector<T>& data,
int start,
int end);
31 std::vector<T>* m_tasks;
32 std::function<void(T&)> m_function;
34 std::vector<std::thread> m_workers;
35 std::condition_variable m_startSignal;
36 std::condition_variable m_stopSignal;
39 std::atomic_int m_currentIndex;
44 std::atomic_int m_startWorkers;
45 std::atomic_int m_stoppedWorkers;
49 #include "threadpool.inl"
Definition: threadpool.h:16