Bug #6117

Transfers allowed into Fibers that have resumed into other fibers

Added by Logan Bowers over 3 years ago. Updated 3 months ago.

Assignee:Koichi Sasada
ruby -v:ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0] Backport:


Consider the following code:

  require 'fiber'

  def foo
    order = []
    main_fiber = Fiber.current
    a = Fiber.new do 
      order << 2
      x = Fiber.new do
        order << 4
        order << 6
      order << 3
      order << 7

    order << 1
    order << 5
    order << 8

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.


#1 Updated by Kenta Murata over 3 years ago

  • Assignee set to Koichi Sasada

#2 Updated by Shyouhei Urabe over 3 years ago

  • Status changed from Open to Assigned

#3 Updated by Koichi Sasada about 3 years ago

  • Target version set to 2.0.0

Please give me a time.

#4 Updated by Koichi Sasada about 3 years ago

Exception seems good.
transfer' andresume' should not be mix.

Any volunteer?
or it will be tagged `next minor'.

#5 Updated by Koichi Sasada almost 3 years ago

Any volunteers?

#6 Updated by Koichi Sasada almost 3 years ago

  • Target version changed from 2.0.0 to next minor

no volunteer.

#7 Updated by Koichi Sasada 3 months ago

  • Description updated (diff)
  • Status changed from Assigned to Feedback

Also available in: Atom PDF