I'm working on an WPF application that has a few threads that are processing information in the background. If one of the threads crashes, it brings down the app. I'm going to correct that by wrapping the function passed to threadstart in a try/catch.
However, I was wondering if I could do one better. It should be possible to write a simple function that will restart a thread if it fails. It would be pretty simple to even put some rules in to try a restart immediately, and then delay on subsequent restart attempts. Basically, it would act as a very basic service control manager for a single thread.
Note: by "restart", I mean simply call the method again on a new thread.
Are there any problems with this approach? Are there any existing solutions out there that I should evaluate before writing this myself?
I only ask because this doesn't seem like a new problem.