digitalmars.D.bugs - [Issue 8418] New: core.thread.Fiber is a Coroutine or Semi-Coroutine?
- d-bugmail puremagic.com (59/59) Jul 22 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8418
- d-bugmail puremagic.com (11/11) Oct 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8418
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: nobody puremagic.com ReportedBy: repeatedly gmail.com --- Comment #0 from Masahiro Nakagawa <repeatedly 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: -------
Jul 22 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8418 Alex Rønne Petersen <alex lycus.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex lycus.org --- Comment #1 from Alex Rønne Petersen <alex lycus.org> 2012-10-10 03:34:06 CEST --- Can you please send a pull request with a doc fix? You probably know the API better than I do. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 09 2012