Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Perl 5.8.8 threads, clean exit

by sundialsvc4 (Abbot)
on Feb 28, 2013 at 17:59 UTC ( #1021082=note: print w/replies, xml ) Need Help??

in reply to Perl 5.8.8 threads, clean exit

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?”

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021082]
and cookies bake in the oven...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-03-21 01:39 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (263 votes). Check out past polls.