Hacker News new | past | comments | ask | show | jobs | submit login

Are these similar in implementation to the upcoming Java Fibers? Those basically yield automatically whenever they perform a blocking operation, so another fiber can be executed.



Ruby fibers yield control to the fiber that spawned them or transfer control to another specific fiber explicitly. That's close to the Continuation model which Loom's fibers are built on top of, but Loom's fibers hide that process of yielding from the user, instead concentrating on providing a more general scheduling API and yielding at certain points inside the core library.

There are quite a lot of other small differences as well since Ruby fibers are always run on the same thread which originally spawned them, whereas Loom's continuations and fibers can be resumed on a different thread.

It is quite possible to implement Ruby fibers in terms of Loom's continuations, and we've done a prototype of this in TruffleRuby (I think Charles Nutter has done one in JRuby as well), and it certainly allows us to support very large numbers of active fibers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: