in reply to Re: killing pp exe on windows leaves child running? ( IsParParentAlive ppsimple.pl ppautolink.pl )
in thread killing pp exe on windows leaves child running?

Portable version using P9Y::ProcessTable ... it works on win32 , probably works on other OS if par works the same there

BEGIN { my $PAR_PROGNAME = "$ENV{PAR_TEMP}\\$ENV{PAR_ARGV_0}.exe"; ## hack use P9Y::ProcessTable(); my $perl_process = P9Y::ProcessTable->process; my $parentpid = $perl_process->ppid; my $ExecutablePath = $perl_process->{exe}; undef $perl_process ; no P9Y::ProcessTable(); sub IsParParentAlive { ( $PAR_PROGNAME eq $ExecutablePath ## doublecheck or $ENV{PAR_SPAWNED} ) and kill 0, $parentpid; } }
  • Comment on Re^2: killing pp exe on windows leaves child running? ( IsParParentAlive P9Y::ProcessTable )
  • Download Code