This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I have a question, hopefully someone will help me......what happens to any thread which has been started in the main method when the main method exits? Does the thread terminate by itself? I think it should terminate.....Please help! Nandini
There is no affect of the thread running the main() method on the threads created by main() method. Other threads keep on running as per how they are programmed even if the main thread dies. The whole program ends only when all the non-daemon threads end. Simple analogy, children don't die when the parents die. Do you think they should? -Paul. ------------------ Get Certified, Guaranteed! (Now Revised for the new Pattern) www.enthuware.com/jqplus
Enthuware Software Support
Joined: Sep 23, 2000
Even daemon threads created by main won't die, if there are other non-daemon threads running. -Paul. ------------------ Get Certified, Guaranteed! (Now Revised for the new Pattern) www.enthuware.com/jqplus