On Thu, Oct 15, 2009 at 10:51 AM, Chris W.
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
(excuse the shameless self-promotion, but…)
You might look at Revactor, or the actor model in general:
Revactor is a Fiber-based implementation of the Actor model, full of
baked-in sync/async I/O.
Here’s an example of doing scatter/gather-type processing of a job
In this case, there are multiple workers handling synchronous I/O
pulling from a central job queue:
What type of jobs are you trying to run? Are they I/O bound or CPU
Revactor can help you in the I/O bound case but not in the CPU bound
However there are many tools available for doing scatter/gather job
among a pool of Ruby processes. That will let you distribute the load
job across multiple CPU cores.