Also, added "thread.c (do_select): perform GC if idle"

https://80x24.org/spew/20180429090250.GA15634@dcvr/raw

And updated "sleepy-gc" git branch @ git://80x24.org/ruby.git
to 10bcc1908601e6f35ebef5ff66476b5cea6da96c.

I'm not sure if native_sleep() is worth doing GC on in most
cases (Mutex#lock, Queue#pop, ...) because that's waiting
on local resources from other threads within our process.

Typical callers of rb_wait_for_single_fd and do_select wait
on external events, so that means our own (Ruby) process is
idle.

I guess Kernel#sleep can do GC work, too (not sure how common it
is to use)

Process.waitpid, File#flock, IO#fcntl(F_SETLKW) are some next
targets where we can try non-blocking operations and GC before
trying blocking equivalents.


Then, the next question is: do we start making all connected
SOCK_STREAM sockets non-blocking by default again? (as in Ruby
1.8)


I'm not sure about nonblock-by-default for pipes,
SOCK_SEQPACKET, and listen sockets; because they have
round-robin behavior which allows fair load distribution across
forked processes.

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