[ruby-core:87504] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid

From: Eric Wong <normalperson@...>
Date: 2018-06-18 00:59:40 UTC
List: ruby-core #87504
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: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next