
18 Feb
2013
18 Feb
'13
6:45 p.m.
Hi, i would like to ask about sample in docs http://www.boost.org/doc/libs/1_53_0/libs/coroutine/doc/html/coroutine/intro... what if several threads run asio::io_service::run(), so is it safe to resume execution state in CompletionHandler in diffrent thread from when execution state was saved ? And what will happen if io_service completes before saving contex (look code below)? s_.async_read_some( boost::asio::buffer( buffer_ + pb_size, bf_size - pb_size), boost::bind( & coro_t::operator(), & coro_, _1, _2) ); // Q: what will happen if handler completes here, before contex switch ca_();