Hi

Report this to rt://PAR for PAR::FAQ

TODO/BUG rt://PAR/PAR::FAQ is also missing a copy/mention of ppsimple.pl and ppautolink.pl

BEGIN { my $PAR_PROGNAME = $ENV{PAR_PROGNAME}; use Win32::Process::Info(); my $pi = Win32::Process::Info->new(); my $parentpid = $pi->GetProcInfo( $$, { no_user_info => 1 } )->[0]->{ParentProce +ssId}; my $ExecutablePath = $pi->GetProcInfo( $parentpid, { no_user_info => 1 } )->[0] ->{ExecutablePath}; undef $pi; no Win32::Process::Info; sub IsParParentAlive { ## IsWin32ParParentAlive $PAR_PROGNAME eq $ExecutablePath ## doublecheck ## $ENV{PAR_SPAWNED} ## equivalent statement and kill 0, $parentpid; } } ## end BEGIN

Usage, if parent a.exe got killed, then PAR_SPAWNED a.exe dies hard

while( 1 ){ print " $$ doing stuff\n"; sleep 1; if( not IsParParentAlive() ){ die "ParParent is dead"; } }

https://metacpan.org/source/RSCHUPP/PAR-Packer-1.049/contrib/docs/who_am_i.txt

https://metacpan.org/source/RSCHUPP/PAR-Packer-1.049/contrib/docs/where_is_it.txt

https://perldoc.perl.org/perlport.html#kill

https://metacpan.org/pod/PAR::Environment#PAR_PROGNAME


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.