How to clone Boost ASIO coroutine on fork?
Looking at the Boost ASIO http server example with coroutines I am wondering if the used cloning method is safe:
// We "fork" by cloning a new server coroutine to handle the connection.
// After forking we have a parent coroutine and a child coroutine. Both
// parent and child continue execution at the following line. They can
// be distinguished using the functions coroutine::is_parent() and
// coroutine::is_child().
fork server(*this)();
With that line a server object is copy constructed from the current object.
But isn't there the possibility that following happens:
operator()()
method is left If it is safe, why?
链接地址: http://www.djcxy.com/p/53166.html上一篇: 了解协程的执行
下一篇: 如何在叉上克隆Boost ASIO协程?