in reply to Re: Will Child Threads block the parent thread?
in thread Will Child Threads block the parent thread?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Will Child Threads block the parent thread?
by BrowserUk (Patriarch) on Feb 27, 2011 at 09:04 UTC | |
|
Re^3: Will Child Threads block the parent thread?
by GrandFather (Saint) on Feb 27, 2011 at 09:39 UTC | |
|
Re^3: Will Child Threads block the parent thread?
by dasgar (Priest) on Feb 27, 2011 at 13:38 UTC |