Well, if the JVM dies any thread in it dies as well so you can't have a thread that never dies at all.
Other than that, you can track whether your thread is alive of course.
Thread has a method for that called isAlive() which returns true if the thread is not dead (but has been started).
You can of course NOT restart a dead thread, so if it dies you'll have to create a new thread for it and start that.
I've found good threading tutorials very hard to find. I'm also still looking for a good threading book, the one I did get (Taming Java Threads) is probably the worst book on programming I've ever had the displeasure of reading and is the first programming book I ever tossed into the trash that wasn't completely outdated.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337