From: ko1@... Date: 2017-01-31T09:23:14+00:00 Subject: [ruby-core:79354] [Ruby trunk Bug#6117] Transfers allowed into Fibers that have resumed into other fibers Issue #6117 has been updated by Koichi Sasada. Can we change this spec yet? ---------------------------------------- Bug #6117: Transfers allowed into Fibers that have resumed into other fibers https://bugs.ruby-lang.org/issues/6117#change-62778 * Author: Logan Bowers * Status: Feedback * Priority: Normal * Assignee: Koichi Sasada * Target version: * ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0] * Backport: ---------------------------------------- Consider the following code: ```ruby require 'fiber' def foo order = [] main_fiber = Fiber.current a = Fiber.new do order << 2 x = Fiber.new do order << 4 main_fiber.transfer order << 6 end order << 3 x.resume order << 7 end order << 1 a.transfer order << 5 a.transfer order << 8 end ``` It produces output: ``` [1, 2, 3, 4, 5, 7, 8] ``` Note: the missing 6. I'd expect either the array to be 1-8 OR for an exception to be raised after 5 when the main fiber attempts to transfer into a again. Either it shouldn't be possible to transfer into a Fiber that is blocked resuming another Fiber, OR it should automatically resume the sub-Fiber. -- https://bugs.ruby-lang.org/ Unsubscribe: