From: Eric Wong Date: 2018-02-05T21:42:19+00:00 Subject: [ruby-core:85417] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid jjyruby@gmail.com wrote: > Excited to see this awesome feature! I'm implemented > fiber-auto-schedule at ruby > userland([light](https://github.com/socketry/lightio)) few > month ago(using monkey patch). Due to ruby complexity IO API > (like: `getc`, `getbyte`, `put,c`, `putbyte`), it's hard to > implement these methods without C, the built-in `Threadlet` or > `Thread::Green` is all I want as a ruby user. (bad news for me > is my library have no meaning to exists). Thank you for your response. I agree a lot of the current IO stuff is difficult or costly to implement outside of C. I hope some dependencies on C can eventually be reduced; but stuff like supporting writev in IO#write_nonblock remind me some things are perhaps best done in C. Anyways lightio can be counted as another reason to implement this feature natively in core (along with previous efforts dating back to Neverblock), so perhaps lightio already served a great purpose :) > Two opinions: > The name `Threadlet` or `Thread::Green` both is easy to > understand and to guess it behaviour, so as a application > level user I think both is fine. I think the `Mutex`, > `ConditonVariable` needed to be `Thread::Green` aware, cause > if I write a thread-safe library using mutex, it's not make > sense if it can't work under `Thread::Green`. Yes, I am strongly leaning towards making mutex, cv and queues green-thread aware and I'm working on improving time representations in core to that end: https://bugs.ruby-lang.org/issues/14431 https://bugs.ruby-lang.org/issues/14452 Unsubscribe: