http://www.perlmonks.org?node_id=1047395


in reply to Re^4: killing threads inside forks
in thread killing threads inside forks

Signals won't interrupt a kernel wait state. join() is a kernel wait state.

my $index=0; foreach my $thread (@threads) #wait for all threads until the end +and insert results to hash { $hash_results{$index}=$thread->join; $index++; } return %hash_results;

Signals and threads do not mix well anywhere.

If you would describe in words, what you want to happen to the child process and its threads when your parent process decides it is time for that something to happen -- without describing the process by which the parent notifies the child, or how the child receives the notification -- then there is probably a good mechanism for doing it, that does not require sticking a spanner in the spokes to get the wheels to stop turning.

Ie:

Until you tell us what you want to do, rather than repeating over and over how you think you ought to do it -- which clearly doesn't work; and probably never will -- there is little we can do beyond keep telling you that what you are trying to do doesn't work.

Which you already know because that's why you came here.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.