Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Parent Thread stops then does child thread also stop?  RSS feed

 
Sudha Lakshman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i had a doubt. In java if i am spawning child thread(s) from a thread other than the main thread of the program, and i stop the parent thread, will the child thread also stop? or do I have to stop the child thread explicitly?(one way of doing this is by using join() method).
In other words if i plan to interrupt the Parent thread then will the child thread also get interrupted and hence stop?
please do let me know.
regards
sudha
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the child will be independant - if you want to interrupt it, you must do so separately.
 
Sudha Lakshman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr.Jim Yingst,
Thank you for replying so promptly and clearing my doubt.
regards
sudha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!