In trying to set this up before the loop, I'm getting the following error.
boost::asio::io_service worker_service;
shared_ptr<boost::asio::io_service::work>
work(new boost::asio::io_service::work(worker_service));
boost::thread worker_thread(&boost::asio::io_service::run, worker_service));
worker_thread.detach();
while (1) {
// ...
worker_service.post(task);
}
2>taskm.cpp(454): error C2059: syntax error : ')'
2>taskm.cpp(454): error C2664: 'boost::thread::thread<boost::asio::io_service&>(const boost::thread::attributes &,F)' : cannot convert parameter 1 from 'overloaded-function' to 'const boost::thread::attributes &'
2> with
2> [
2> F=boost::asio::io_service &
2> ]
2> Reason: cannot convert from 'overloaded-function' to 'const boost::thread::attributes'
2> No constructor could take the source type, or constructor overload resolution was ambiguous