Boost logo

Boost :

Subject: Re: [boost] [fiber] mini review - symmetric a. asymmetric continuation
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2011-02-09 20:10:13


On Feb 9, 2011, at 10:55 AM, Oliver Kowalke wrote:

> I've uploaded a new version to boost vault (section 'Concurrent Programming') which contains to fiber implementations - sym_fiber (symmetric fiber/continuation) and asym_fiber (asymmetric fiber/continuation).
>
> I'd like to ask for a mini review in order to get a bit feedback if the design is appropriate.
>

I am working on a project that will be using your fiber library in a manner similar to how sym_fiber is intended. Before you released this update I was planning a design using the asym_fiber (which looks like the old 'fiber') that would simply call 'run()' on the fiber it intended to 'switch to' under the assumption that I could have any other fiber 'resume' by calling run on it again. The only apparent difference is that with 'yield()' you go back to the caller and with run() you go to some other context (which could also be the caller).

Perhaps I am missing something fundamental, but I didn't see a need for two different fiber's.

fiber a(funcA);
fiber b(funcB);

void funcA()
{
        b.run(); // == a.switch_to(b);
}
void funcB()
{
        a.run(); // == b.switch_to(a);
}

> Oliver
> _______________________________________________
> 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