12 Feb
2009
12 Feb
'09
8:12 p.m.
If I use run there application hang, it doesn't use CPU and doesn't eat memory, just stop responce.
io_service::run() blocks until all the work is done. However, you can run io_service in another thread, like this: boost::thread thread(boost::bind(&io_service::run, &io_service_)); //note that io_service_ must outlive the thread then you can use this io_service with any number of timers/sockets - all their handlers will run in that thread.