On Sat, 15 Dec 2018 at 21:21, Damian Jarek
As for the echo example in Beast: looks to me like there is a work guard for the I/O executor in state of the echo_op, so it seems to be correct.
What I'm concerned about now is the lack of a work guard for the Executor associated with the CompletionHandler. I have modified your example here https://wandbox.org/permlink/IwmegLNlAKPs9tDP . It does work without the second work guard, but not sure why. I'm concerned about the work count reaching zero in the fourth output line, before the first "Completion Handler called". https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/io_conte... says: "Once the count of unfinished work reaches zero, the io_context is stopped and the run() and run_one() functions may exit." So ASIO would have been free to stop ctx2 there, right?