From: Erik Veenstra Date: 2008-06-12T19:05:14+09:00 Subject: Re: Design question on threads. > I have a script that launches a bunch of threads. Each thread > sleeps for the most part, wakes up, fetches a page, does some > parsing, and goes back to sleep again. Really simple. > However, on occasion, either the parser or the httpclient > raises an exception and the thread dies. I can set > Thread.abort_on_exception to true. But I'd much rather that > the thread just restarts. More often than not these > exceptions are not cause enough for the thread to die. I would rather keep the retry in the body of the thread. I suppose you've something like this: Thread.fork do loop do # The real stuff... sleep 60 end end Simply add the retry: Thread.fork do loop do begin # The real stuff... rescue SomeException # Be careful! sleep 1 retry end sleep 60 end end gegroet, Erik V. - http://www.erikveen.dds.nl/