Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] How to deal with no-connect and/or read-timeout
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2013-06-26 05:35:52


2013/6/26 Bjorn Reese <breese_at_[hidden]>

> On 06/26/2013 08:48 AM, Oliver Kowalke wrote:
>
> Instead of boost.context I would suggest using boost.fiber
>>
>
> Could you provide some guidance about the pros and cons of
> Context versus Fiber versus Coroutine so that we are in a better
> position to select the appropriate module?

boost.context - low-level library, provides mechanism to switch between
execution context (assembler etc.)
boost.coroutine - uses boost.context, resume-and-suspend explicitly
execution of coroutine-fn,
                         for example docu show how to use a coroutine to
suspend reading from a std::stream (special character was not received ->
usually stream blocks)
boost.fiber - uses boost.context, provides a framework like boost.thread,
fibers not explicitly resumed/suspended (done by mutext/condition/barrier
...), all fibers run concurrent
                  in the same thread

Which lib you choose depends on your preferred programming model.



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