From: Eric Wong Date: 2018-09-02T09:24:31+00:00 Subject: [ruby-core:88806] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid > 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/20180827201123.4364-1-e@80x24.org/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/20180902091557.24130-1-e@80x24.org/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: