80 - Resuming a fiber in update or draw results in an exception on Windows #79

Closed
jlnr opened this Issue Mar 8, 2011 · 1 comment

1 participant

@jlnr
The Gosu Library member


The code below fails with an unhandled exception, as soon as @fiber.resume is called.

require 'gosu'

class GameWindow < Gosu::Window
def initialize(fiber)
super(640, 480, false)
@fiber = fiber
end

def update
@fiber.resume
end

def draw
end
end

fiber = Fiber.new do
loop do
puts 'fiber resumed'
Fiber.yield
end
end
fiber.resume
fiber.resume
window = GameWindow.new(fiber)
window.show

My configuration:

Windows 7 [Version 6.1.7600]
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
gosu (0.7.24 i386-mingw32)

Also tried on an XP machine with the same outcome.

Perhaps, EventMachine has a similar issue?
http://redmine.ruby-lang.org/issues/show/3523


Original link: http://code.google.com/p/gosu/issues/detail?id=80

@jlnr
The Gosu Library member

Closing this, as I don't feel that Fibers have ever really caught on.

@jlnr jlnr closed this Sep 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment