What I'm creating is a job queue.  A thread from a central thread pool 
grabs a job and then executes it.  In very special circumstances, when a 
job on the queue is waiting for a response from another job on the 
queue, the job needs to pause and be put back onto the queue to wait for 
a value.

With fibers I could call Fiber.yield() and that would kick control back 
out to the thread who would push it back onto the queue.  The problem 
with your solution, in this particular case, is that the fiber couldn't 
be resumed from where it last exited and would have to be re-ran from 
the beginning.

Thanks for the pointer to the book.

Christopher Dicely wrote:
> It seems pretty fundamental. You might be able to work around it by
> using Procs to store the jobs but then having the thread that runs
> each Proc create a Fiber to run the Proc when it is run (I haven't
> tested it, but it seems like it should work.) Its not mentioned in the
> documentation for Fiber (though it should be), but it is mentioned on
> page 186 of the most recent edition of the Pickaxe (_Programming Ruby
> 1.9: The Pragmatic Programmers' Guide_, by Dave Thomas.)

-- 
Posted via http://www.ruby-forum.com/.