(for
sumanth: you find nothing new here. For the rest: I want to summarize a discussion we had on the CB, hopefully other monks can profit from it).
This is a XY Problem. The reason not to simply call $thread->join was that this command reveals error messages like attempted to free unreferenced scalar...
I tested the code that produced the errors, and confirmed them on perl 5.8.8. On 5.10.0 they were fixed.
Now sumanth can't upgrade to 5.10.0, and tries to find a workaround.
While a workaround is perfectly fine (IMHO) when a feature is missing, I think in this case here it is folly, because
- generally working around a buggy environment is unproductive, and usually doesn't work in the end
- the ->join call probably only reveals the error, it's likely not the cause. That means that the workaround is in the wrong place (if there is a right place at all)
- There seems to be an error somewhere that in perl's reference counting. If there is, and it is triggered by a program, it can result in bugs that are very hard to reproduce and hard to find, and perhaps even data corruption or loss.
So I think to preserve your sanity, dear sumanth, you should find a different solution. Perhaps without threads (maybe forks or non-blocking IO might help?), perhaps with a second perl installation, perhaps with a different programming language.
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.