Boost logo

Boost Users :

Subject: Re: [Boost-users] [Asio] Does stop() cancel handlers post()ed to io_service?
From: Martin Gernhard (gernhard.martin_at_[hidden])
Date: 2013-06-26 06:31:33


Marat Abrarov wrote:
> It would be more accurate to say "on Windows asio::io_service::stop()
> does not cancel already queued (!) handlers". See example below.

Your are right, of course. I should have been more specific. And chaining
handlers like this is certainly another way to achieve the desired effect,
thanks!

However, I'm still interested whether stop() should always cancel the queued
handlers, i.e. if this is a bug (on windows). The io_service documentation
says
this regarding the use of a work object (http://alturl.com/98rvq):

  "To effect a shutdown, the application will then need to call the
io_service
  object's stop() member function. This will cause the io_service run() call
  to return as soon as possible, abandoning unfinished operations and
without
  permitting ready handlers to be dispatched.
  Alternatively, if the application requires that all operations and
handlers
  be allowed to finish normally, the work object may be explicitly
destroyed."

So am I misreading this or does this say io_service::stop() has to cancel
all
queued handlers?

Regards,
Martin



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net