[Issue 16272] Yield like semantics for function execution

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 12 15:53:34 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16272

--- Comment #2 from TeddyBear12311 at gmail.com ---
(In reply to Mathias Lang from comment #1)
> This is already possible using a library solution, see
> https://dlang.org/phobos/std_concurrency.html#.Generator

I believe their is a subtle difference. I could be mistaken because I don't
know the depth of fibers.

Fibers are more concurrency related and imitate a task switch. In this case
with functions, no task switching like behavior is needed. Just a push and pop
of the locals and a few other little things. It may be exactly what a fiber
does though?

I'm thinking it is more like thread(heavy) > fiber(medium) > functional
yield(light weight).

--


More information about the Digitalmars-d-bugs mailing list