Forum: Ruby-core [ruby-trunk - Bug #6117][Open] Transfers allowed into Fibers that have resumed into other fibers

78cd69c40dc03e431a12f7b2d22274e6?d=identicon&s=25 Logan Bowers (Guest)
on 2012-03-06 08:19
(Received via mailing list)
Issue #6117 has been reported by Logan Bowers.

----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117

Author: Logan Bowers
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


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
      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.
7cca11c5257fda526eeb4b1ada28f904?d=identicon&s=25 Kenta Murata (Guest)
on 2012-03-11 09:50
(Received via mailing list)
Issue #6117 has been updated by Kenta Murata.

Assignee set to Koichi Sasada


----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117

Author: Logan Bowers
Status: Open
Priority: Normal
Assignee: Koichi Sasada
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


=begin
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
        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.
=end
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2012-10-30 01:22
(Received via mailing list)
Issue #6117 has been updated by ko1 (Koichi Sasada).

Target version set to 2.0.0

Please give me a time.
----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117#change-31958

Author: loganb (Logan Bowers)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


=begin
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
        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.
=end
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2012-11-26 01:49
(Received via mailing list)
Issue #6117 has been updated by ko1 (Koichi Sasada).


Exception seems good.
`transfer' and `resume' should not be mix.

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

----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117#change-33919

Author: loganb (Logan Bowers)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


=begin
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
        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.
=end
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2012-12-19 23:49
(Received via mailing list)
Issue #6117 has been updated by ko1 (Koichi Sasada).


Any volunteers?

----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117#change-34876

Author: loganb (Logan Bowers)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


=begin
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
        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.
=end
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2013-01-07 03:47
(Received via mailing list)
Issue #6117 has been updated by ko1 (Koichi Sasada).

Target version changed from 2.0.0 to next minor

no volunteer.

----------------------------------------
Bug #6117: Transfers allowed into Fibers that have resumed into other
fibers
https://bugs.ruby-lang.org/issues/6117#change-35241

Author: loganb (Logan Bowers)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category:
Target version: next minor
ruby -v: ruby 2.0.0dev (2012-03-06) [x86_64-darwin11.3.0]


=begin
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
        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.
=end
This topic is locked and can not be replied to.