How resume the execution of a stackful coroutine in the context of its strand?

前端 未结 4 1636
情深已故
情深已故 2020-12-15 02:07
using Yield = asio::yield_context;
using boost::system::error_code;
int Func(Yield yield) {
  error_code ec;
  asio::detail::async_result_init

        
4条回答
  •  没有蜡笔的小新
    2020-12-15 02:23

    You are complicating things by creating threads out of the executor framework provided by Boost Asio.

    For this reason you shouldn't assume that what you want is possible. I strongly suggest just adding more threads to the io_service and letting it manage the strands for you.

    Or, you can extend the library and add the new feature you apparently want. If so, it's a good idea to contact the developer mailing list for advice. Perhaps they welcome this feature¹?


    ¹ (that you, interestingly, have not described, so I won't ask what the purpose of it is)

提交回复
热议问题