Well, a thread can't be joined unless it returns or reaches the end of it's code block. In my various thread examples posted, I use a $die shared variable to signal the thread to return, then it can be joined. If you can't use that in your thread code block, you can put a while() loop at the end of your main code, which checks the threads->list, until all are joined. See
Just can't get threads to work The latest threads version available on cpan, has the ability to summarily kill a thread, which you can use on pesky threads that are locked up.
If that fails, use detached threads, which don't need to be joined, and will exit when the parent exits.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.