[Backgroundrb-devel] Need help with singleton worker

Isak Hansen isak.hansen at gmail.com
Mon May 21 08:27:47 EDT 2007

On 5/16/07, Michael Siebert <siebertm85 at googlemail.com> wrote:
> 2007/5/16, Isak Hansen <isak.hansen at gmail.com>:
> > There's the thread running do_work, and I'd think there are additional
> > thread(s) adding jobs to the worker?
> no there is only one process running. for the exact things going on, ask
> ezra or skaar, for me, it just works great

One process yes, but I believe add_job() is called from a different
thread than do_work, which is stuck in an infinite loop.

I'm not sure Array isn't thread safe (been getting conflicting
feedback about that), but figure it can't hurt to use a mutex around
code accessing the job queue.

How about cleanup? Say we eventually get 5-6 different named workers,
that's quite a bit of memory.

Should we just trust the OS to swap those processes out, or would you
guys recommend having the worker deleting itself and terminate after
for instance X minutes of idle time?


More information about the Backgroundrb-devel mailing list