Well, if you want to be sure a thread has finished, in a sense you need to know the final report has been completed -- you're just not going to read it.

The polite thing to do is to wait for the report, collect it, but wait at least until the thread has left your office before tossing the report in the bin.

I look at it this way: when the mother thread terminates the system could wait for all the child threads to finish before knocking the process on the head. But it cannot know that the main thread has terminated cleanly, so the children may be on its hands forever waiting for their dead mother, taking up space, demanding attention, needing to be changed, etc. So the system promptly shoot them -- it's a hard world, with no room for motherless threads.

I suppose mother could somehow promise the system that all the children will leave soon, of their own accord. But, frankly, would you take the word of a delinquent mother ? As if !


In reply to Re^7: using many threads and conserving stack size by gone2015
in thread using many threads and conserving stack size by danmcb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.