
11 May
2012
11 May
'12
6:38 a.m.
it worked! Thank you so much Igor. I changed it this way: int main(int argc, char* argv[]) { boost::asio::io_service::work work(io_service); boost::thread thrd_io(boost::bind(&boost::asio::io_service::run, &io_service)); boost::thread workerThread(workerFunc); ... }
Can I ask why we needed io_service::work? in windows, it did not require it.
It's not a matter of platform, it's just a timing. You had a race condition, which produced different results under different circumstances.