Had I put the join statement in front of the for loop in the main code section, the parent would have waited for the child thread to complete before entering the main for loop

Yikes!!!! I had done just that!!!! I had my "join" statement as soon as I had created the child thread - obviously, Perl waited for the child to finish and only then, it allowed the main program to do its work. I have put the join statement at the end of the code now ... Let's see if that works!

As far as code goes, my code is too huge to put in on this page.. I mean.. many subroutines being used and to make complete sense, I had to put in all of that code here... Just needed to understand the concept, and I realized what I had done wrong...

Btw, are there any other web pages / tutorials / books / chapters that make us understand Threads in Perl in a better way? PerlDoc has very few examples and it's difficult to understand some concepts ... I'm really not very happy with the perldoc help pages.


In reply to Re^2: Will Child Threads block the parent thread? by vishi
in thread Will Child Threads block the parent thread? by vishi

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.