|
I am starting a series of detached threads and I save the thread object in a hash as follows:
my $thr = threads->new(...);
if ($thr) {
my $nThreadTid = $thr->tid();
$aActiveThreads{$nThreadTid} = $thr;
}
Periodically I check if specific threads are still running as follows:
my $thr = $aActiveThreads{$nThreadTid};
if($thr and $thr->is_running ) {
#thread is running
...
}
This works well and detects exits from the perl process OK, however I have found that if I kill the thread externally (I used process explorer) the $thr->is_running still returns true even though the thread has definitely been killed and is no longer outputting log messages etc.
I am using threads version 1.59 on Windows with perl 5.8.8 built by a colleague of mine.
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Im not sure whether this is a bug or usage issue. Any suggestions would be most welcome.
JC
|