eregontp / gmail.com wrote:
> Should lib/timeout.rb be removed then?

Yes, and the rdoc will be moved if accepted.

> Why is it moved to core, could it stay an extension?

Right now it needs to hook into the core timer thread without
needing additional threads.  I already run into resource
exhaustion problems with timer-thread when testing.

I'm working on making all wait functions aware of it:
rb_wait_for_single_fd, rb_thread_fd_select, rb_thread_sleep*, etc.

Eventually, I also want to get rid of timer thread (for POSIX)
but it might not be easy

> Note that there are pure-Ruby implementations of Timeout using a single Ruby Thread, like
> https://github.com/oracle/truffleruby/blob/71df1ecc4fd9e318b5bd3998cfaeb85a96de7a8b/lib/truffle/timeout.rb (originally from Rubinius)

Using one extra Thread is already too much for me.

> and that WEBrick has basically its own version of Timeout, using a single Thread:
> https://github.com/ruby/ruby/blob/48efa44719d03eb067d27b30c68cf821074aedce/lib/webrick/utils.rb

Yes, I want to get rid of that by making Timeout better.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>