From: "Eric I." Date: 2008-07-01T06:52:50+09:00 Subject: Re: help with threads On Mon, Jun 30, 2008 at 12:54 PM, Oliver Fox wrote: > hi all, > i'm trying to do some automated tasks with threads. > Basically, my app is initialized with an input file, and an output path > and some processing is done on that. > I'm trying to automatically detect when the thread dies, so that it can > tell the parent class that this thread is complete. > Is there a nice way to do this without polling every thread? I seem to > recall something relating to the Rufus::Scheduler stuff being able to do > similar, but i can't remember the name of that or where i found it. any > information would be great! Hi Oliver, Have you looked at the Monitor class and using MonitorMixin? I believe your main thread could do a "wait_while" and your child threads could do a "signal" when they're done to notify the main thread. This is assuming you have multiple child threads. If there's only one, then doing a "join" would be easier. I hope that helps, Eric ==== LearnRuby.com offers Rails & Ruby HANDS-ON public & ON-SITE workshops. Please visit http://LearnRuby.com for all the details.