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

From: Eric Wong <normalperson@...>
Date: 2018-09-02 09:24:31 UTC
List: ruby-core #88806
> https://bugs.ruby-lang.org/issues/13618
> 
> I have at least one more preparatory change which should be fairly
> straightforward; but unfortunately makes some of the current code
> more verbose (because of `container_of'):
> 
>   https://80x24.org/spew/[email protected]/raw
>   "unify sync_waiter, waitpid_state, waiting_fd w/ rb_sched_waiter"

Here's a work-in-progress patch showing how Queue+SizedQueue would
work with "struct rb_sched_waiter":
https://80x24.org/spew/[email protected]/raw

It goes on top of my coro-r64610 branch posted at [ruby-core:88800]:
https://public-inbox.org/ruby-core/20180901131301.5peghdyrtmks5mka@dcvr

Several tests are skipped because Thread::Coro#stop?/#status/#[]=
aren't implemented, yet.  Will fix later when not AFK.

Another weird case to think about (not supported, yet):

How should Coro switching work inside Signal.trap?

   q = Queue.new
   trap(:INT) { q.push(:INT) }
   q.pop

I guess we'll need to figure out a way to support it...

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

In This Thread