From: Eric Wong Date: 2018-06-18T00:59:40+00:00 Subject: [ruby-core:87504] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid Also, I will extract timeout support into separate feature. The basic idea is that (regardless of how efficient(*) Timeout is): Timeout.timeout { io.read(...) } Timeout.timeout { io.write(...) } Timeout.timeout { io.read(...) } Timeout.timeout { io.write(...) } ... Will always be less efficient than: Timeout.timeout do io.read(...) io.write(...) io.read(...) io.write(...) ... end So we should encourage the latter, not the former (as this patch does). I will try to make both as fast as possible, but the former will always be faster because registering the timeout (either in userspace in our VM or the OS kernel) always has a highish cost. Unsubscribe: