title: Do child threads exit when the parent thread terminates
body: <p>I was doing some multithreaded programming in Visual studio C++ using the calls beginthreadex, endthreadex.</p>
  
  <p>I create a child thread thread1. The child thread runs on a function which never exits as it has an infinite loop. Now if the parent thread terminates with error or finishes successfully, does the child thread also exit? My doubt is - is there any situation where the child thread is alive even after the main program exits? </p>
  
  <p>For linux how should this case be?</p>