Koichi Sasada wrote: > > I think [Consumer](http://nome.github.io/coroutines/Consumer.html) is an example of a semi-coroutine (in the sense that it uses Fiber.yield, not Fiber#transfer) that benefits from having Fiber#raise. > ... Cons...nome (Knut Franke)
> I understand this feature helps some libraries. But I can't understand why it is important. Without Fiber#raise, libraries need to use some rather inelegant and inefficient workarounds (wrapping or tagging exceptions, wrapping Fiber...nome (Knut Franke)
For some more sophisticated examples, see https://github.com/nome/coroutines. The library does work with vanilla Ruby, but the patch improves performance. Also, similar code can be simplified by using Fiber#raise. Compare e.g. the two...nome (Knut Franke)
While it is possible to implement this in pure Ruby (by wrapping Fiber.yield and Fiber#resume), this feels like a low-level feature that ought to be provided out of the box. Also, the C implementation is more straight-forward, and more e...nome (Knut Franke)
The attached patches increase performance of switches between Fibers by ~17% on my test system (Linux, gcc 4.8.2). Patches 1-3 are purely cosmetic, but included here because submitting them separately would cause conflicts between the...nome (Knut Franke)