Internal and external iteration, fibers

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Mon Jan 21 00:27:26 PST 2013


On Mon, 21 Jan 2013 03:27:49 +0100
"deadalnix" <deadalnix at gmail.com> wrote:

> On Sunday, 20 January 2013 at 20:19:56 UTC, Nick Sabalausky wrote:
> > If we need to resort to using D-as-a-DSL-inside-D to get decent
> > coroutines, then that just further proves the need for a real 
> > coroutine
> > support in the language.
> 
> A good part of the job is done with Fibers. The biggest problem I 
> see is module constructor and switching from TLS to fiber local 
> storage.

That's no good for general-purpose, then. Fibers may be light-weight
compared to threads, but (as I learned when *I* made a fiber-based
solution last year) fibers still have way to much overhead to be a
*general-purpose* approach the the matter. For more info, see jerro's
posts here:

http://forum.dlang.org/thread/jno6o5$qtb$1@digitalmars.com

So like I already said a few posts back, *ALL* the currently-possible
solutions in D have issues:

opApply: Not a range; awkward to use

Manually-Created Input Range: Event-loop-style instead of
procedural. Yuck.

Real Fibers: Too slow to be general-purpose.

Stackless "fibers": Requires gross syntactical contortions much like
opApply does.



More information about the Digitalmars-d mailing list