Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: killing pp exe on windows leaves child running? ( IsParParentAlive P9Y::ProcessTable )

by Anonymous Monk
on Sep 01, 2019 at 04:23 UTC ( [id://11105366]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found