From: Chris Wailes Date: 2009-10-15T04:13:50+09:00 Subject: Re: Problems With Fibers in Threads OK, that does appear to be the problem as the Fibers are created in various threads then executed by a thread from the thread pool. Is the inability to call a fiber across different threads a 'feature', or simply a consequence of implementation? Is this going to remain the situation in the future? Is there a way around it? Where is this behavior mentioned? 7stud -- wrote: > Tony Arcieri wrote: >> Are you trying to reschedule a fiber from a different thread? Afaik >> that >> doesn't work. > > ...for instance: > > > require 'thread' > > q = Queue.new > > f1 = Fiber.new do > puts "hello" > Fiber.yield > puts "world" > end > > q.push(f1) > > thr = Thread.new do > f = q.pop > f.resume > f.resume > end > > thr.join > > --output:-- > r1test.rb:15:in `resume': fiber called across threads (FiberError) > from r1test.rb:15:in `block in
' -- Posted via http://www.ruby-forum.com/.