Hacker News new | ask | show | jobs
by lukegru 1132 days ago
Does this use the Fiber Scheduler API to figure out which fibers are blocking? If so, why does this need libev - I'm guessing it's to do with performance?
2 comments

No, Polyphony has a design that diverges from the model proposed by the FibeScheduler API. Note that the FiberScheduler API included with Ruby is only an interface, not an implementation. Polyphony uses io_uring on recent Linux kernels, or libev otherwise to perform I/O operations and implement timeouts.
does it use anything specific on darwin and/or freebsd or does it fall back to libev?
On non-Linux systems it just uses libev to for I/O readiness and for timers, and uses normal syscalls for the actual I/O.
alright! any plans to use kqueue directly?
No. libev provides a nice abstraction over different operating systems, and has good performance. I don't think coding a whole new backend against kqueue is worth the effort.
Fiber::Scheduler is only an interface. You still need an IO multiplexer underneath it.
This is not what I don’t understand with the Ruby Team, why did they not ship Fiber Scheduler with an implementation and just an interface?

Dis they expect everyone to implement the scheduler om their own?

I am aware of the existing fiber scheduler implementations you can get on Ruby Gems but there should be official implementation.