
28 Sep
2009
28 Sep
'09
7:43 a.m.
This is a small program using deadline_timer with expiration time 1 millisecond. http://snipt.org/nKm When I run it over and over it will evantually stuck lie this: http://img39.imageshack.us/img39/1292/handh.jpg and I don't know why. The io_service.run() is started in another thread. The main thread is waiting for pressing 'any key', the I call post() method to cancel() the timer. But sometimes as you can see on the screenshot, cancel() is invoked, but the timer continues to run. It seems that run() method doesn't invoke the timer handler with boost::asio::error::operation_aborted error. I've noticed this effect will be encouraged by high CPU usage. Vista 64bit, VC++ 2008 Express, Boost 1.40.0 Why this is happening?