0

One can add task with post() but how to clear all the pool in the io_service? (so it stops processing any task and clears the pool)

mimosa11
  • 31
  • 4
  • This very detailed answer may help: [Confused when boost::asio::io_service run method blocks/unblocks](http://stackoverflow.com/questions/15568100/confused-when-boostasioio-service-run-method-blocks-unblocks). – mins Apr 08 '15 at 18:46

1 Answers1

1

The linked answer has all the details: Confused when boost::asio::io_service run method blocks/unblocks

The short story: stop() stops processing tasks from the queue(s) (any handlers are not interrupted of course).

reset() prepares the io_service for re-use.

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633
  • @mimosa11 Read carefully this answer, again and again until you really understand it, and so you will learn easily asio, one of the most valuable libraries. – Jean Davy Apr 09 '15 at 20:05