21 #ifndef GRPPI_NATIVE_POOL_H 22 #define GRPPI_NATIVE_POOL_H 24 #include <boost/asio/io_service.hpp> 25 #include <boost/bind.hpp> 26 #include <boost/thread/thread.hpp> 33 boost::thread_group threadpool;
34 boost::asio::io_service ioService;
35 std::vector<boost::asio::io_service::work> works;
46 works.push_back( std::move(boost::asio::io_service::work(ioService)));
47 for(
unsigned int nthr= 0; nthr < num_threads; nthr++){
48 threadpool.create_thread(
49 boost::bind(&boost::asio::io_service::run, &ioService)
56 threadpool.join_all();
Definition: callable_traits.h:24
void initialise(int num_threads)
Definition: pool.h:45
void create_task(T task)
Definition: pool.h:43
~thread_pool()
Definition: pool.h:54
thread_pool()
Definition: pool.h:39