Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Coroutine] sample in docs
From: Lukas Czaja (lukas70000_at_[hidden])
Date: 2013-02-18 13:45:08


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.html
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_();



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net