How to create a thread pool using boost in C++?
How do I create a thread pool using boost in C++, and how do I assign tasks to the threadpool? Jeroen Bollen The process is pretty simple. First create an asio::io_service and a thread_group. Fill the thread_group with threads linked to the io_service. Assign tasks to the threads using the boost::bind function. To stop the threads (usually when you are exiting your program) just stop the io_service and join all threads. You should only need these headers: #include <boost/asio/io_service.hpp> #include <boost/bind.hpp> #include <boost/thread/thread.hpp> here is an example: /* * Create an asio: