Is there a thread pool implementation in boost?
This question is related to boost::threadpool::pool
, and it says it here on sourceforge , but I can't find it in the boost docs .
Why is it called boost if not on boost?
PS: I know how to use Boost :: ASIO io_service
to create a thread pool, but I would like to understand what it is boost::threadpool
.
As a former Boost.Thread-enabled helper, I've been asked often why Boost.Thread doesn't provide a thread pool. The simple answer is that it is actually too easy to roll your own, for example here is a fine threadpool implementation in just a few lines of C ++ .
This is too small a thing for Boost, and too much bike drop will happen when trying to send a general purpose thread pool. So you can misuse ASIO to implement a thread pool (just as easily), roll your own, or just use the thread pool in the C ++ 11 standard library available via std::async
.