Class ThreadPool
Defined in File ThreadPool.h
Nested Relationships
Nested Types
Class Documentation
-
class ThreadPool
a pool of threads with work stealing, an executor
Public Functions
-
explicit ThreadPool(std::size_t p = 0, std::int64_t spin = 2000000)
a pool of p threads, the caller included (the number of the hardware threads if 0), whose idle workers look for tasks for spin ns before they sleep
-
ThreadPool(const ThreadPool&) = delete
-
ThreadPool &operator=(const ThreadPool&) = delete
-
~ThreadPool()
stops the workers, which first finish their tasks
-
inline std::size_t concurrency(void) const
the number of threads, the caller included
-
explicit ThreadPool(std::size_t p = 0, std::int64_t spin = 2000000)