http://d.puremagic.com/issues/show_bug.cgi?id=8418
Summary: core.thread.Fiber is a Coroutine or Semi-Coroutine? Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: druntime AssignedTo: nob...@puremagic.com ReportedBy: repeate...@gmail.com --- Comment #0 from Masahiro Nakagawa <repeate...@gmail.com> 2012-07-22 18:28:52 PDT --- First, I tried following Coroutine code with Fiber, but caused segmentation fault. ----- Fiber child, parent; child = new Fiber(delegate() { writeln("before call parent"); parent.call(); // invoke parent fiber writeln("after call parent"); }); parent = new Fiber({ writeln("before call child"); child.call(); writeln("after call child"); }); parent.call(); % dmd -run co.d before call child before call parent after call child --- killed by signal 11 ----- Second, I tried Semi-Coroutine code. It works fine. ----- Fiber child, parent; child = new Fiber(delegate() { writeln("before call parent"); Fiber.yield(); // return to parent. writeln("after call parent"); }); parent = new Fiber({ writeln("before call child"); child.call(); writeln("after call child"); }); parent.call(); % dmd -run co.d before call child before call parent after call child ----- core.thread.Fiber now provides Semi-Coroutine APIs(call and yield), so I guess former code is invalid. If so, Fiber's document should describe such limitation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------