Skip Menu |

This queue is for tickets about the forks CPAN distribution.

Report information
The Basics
Id: 56131
Status: resolved
Priority: 0/
Queue: forks

People
Owner: Nobody in particular
Requestors: jpritikin [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.33
Fixed in: (no value)



Subject: no easy way to suppress exit diagnostics
There is no easy way to suppress: print STDERR "Perl exited with active threads:\n" ."\t$running_and_unjoined running and unjoined\n" ."\t$finished_and_unjoined finished and unjoined\n" ."\t$running_and_detached running and detached\n"
This behavior is the same as native threads.pm. I'm not sure I should deviate from this. Generally, you should take action and correct your code if you see this warning, as threads are being hard-terminated that were not given a chance to complete. Best practice is to wait/join for all threads, or send termination signals to unresponsive or detached threads if necessary, from the main thread before your script exits. This is why I believe this warning has historically been un-suppressible in threads (other than by suppressing STDERR). On Tue Mar 30 16:57:03 2010, JPRIT wrote: Show quoted text
> There is no easy way to suppress: > > print STDERR "Perl exited with active threads:\n" > ."\t$running_and_unjoined running and unjoined\n" > ."\t$finished_and_unjoined finished and unjoined\n" > ."\t$running_and_detached running and detached\n"
On Wed Mar 31 11:17:33 2010, RYBSKEJ wrote: Show quoted text
> Generally, you should take action and correct your code if you see > this warning, as threads > are being hard-terminated that were not given a chance to complete.
Ah, OK To the end of my script, I added: $_->kill('SIGKILL') for threads->list; $_->join for threads->list; That seems to work. Thanks.
Ticket closed.