Pardon me for resurrecting a slightly-old thread here, but I do have a question that’s just bugging me. Even though the particular code-sample given here does not actually print a message when it sends a KILL (phony-)signal to the threads, the OP says that the signal never gets sent to the second thread.
The example does seem to pretty closely match the one given in the PerlDoc, which at least implies that the signaling to multiple threads ought to be successful. The example, in other words, appears to be pretty much “by the book.”
In the “Edit,” portion, which I am just now reading, the OP says that (in another Perl version) the loop that sends the signals blocks after sending the first signal. Is this presumably the cause of the previously described behavior, “thread #2 never gets a signal?”
I understand that these are “not real signals,” and it’s easy enough to glom why not. But does the implementation actually block the sender?! Is that true of all the (all equally-phony) signal types?
How might the OP have salvaged this situation, in your (specifically, your...) opinion? Is there an alternate way of doing a similar thing (“interrupting a child thread, more or less”) that would have been successful and reliable across versions? Or is it simply, “irreconcilably broken?”
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||