Boost logo

Boost :

From: atkinson julian (julian.atkinson71_at_[hidden])
Date: 2008-07-26 10:11:34


To hopefully ease your mind - there was no bug in boost::coroutine, i simply
failed to pass the std::no_throw on coroutine invocation and the asio
component of the doc was simply a little brief for a newbie like me. The
justification and need for the no throw wrt futures is explained well
elsewhere.

I really hope its possible to find the time/ motivation to do what you
believe is needed re boost inclusion since it represents such a powerful
(correct) programming model that can be applied in many area's - networking
/ actor model / simulation etc. the non thread migratability of coroutines
is also easy to adapt to - by employing a couple of asio pumps.

After discovering my mistake and progressing a little I now have 1000
simultanious and active connections being managed trivially on an under
powered laptop . This with a very straight-forward and linear code model
(and with no expensive context switches or synchronization primitves needed
at this particular layer level ) thanks to the coroutine support.

On Fri, Jul 25, 2008 at 1:27 PM, Giovanni Piero Deretta <gpderetta_at_[hidden]
> wrote:

> On Fri, Jul 25, 2008 at 2:44 PM, Mathias Gaunard
> <mathias.gaunard_at_[hidden]> wrote:
> > atkinson julian wrote:
> >> Hi, the combination of asio and coroutines would seem to represent a
> little
> >> bit of magic (layering a linear code model over an async event framework
> and
> >> without the attendant issues involved in multithreading).
> >
> > Yes, it would be pretty cool.
> > However, couldn't the syntax be directly that of blocking asio calls?
> >
> > coro::future<error_type, iterator_type> future(self);
> > resolver.async_resolve(query, coro::make_callback(future));
> > coro::wait(future);
> >
> > is really the same thing as
> >
> > tuple<error_type, iterator_type> result = resolver.resolve(query);
> >
>
> Yes, it is. The point is that you can have many coroutines in flight
> at the same time. With the blocking call variant you must have
> multiple threads to do the same thing.
>
> Julian: sorry for not replying, I'm far from a compilable
> boost.coroutine installation ATM and cannot test your code (and
> probably I won't be for two weeks). BTW, yes, the example in the doc
> is wrong and your code should Just work; if it doesn't it is a bug in
> the library.
>
> --
> gpd
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk