Thank you for the reply ( marioroy? )!

In the first example, it was necessary to move the SIG handlers below the mce_loop statement, else it gave error:

MCE::exit: method is not allowed by the manager process at mce.pl line + 19.

After moving the SIG handlers, it gives no error but does not appear to execute any of the code in END:

PID 18566 Forked child with 18568 Forked child with 18569 Forked child with 18571 Forked child with 18572 Forked child with 18570 Forked child with 18573 ^C ## mce.pl: caught signal (INT), exiting Killed
The second example you provided gives the same result:
PID 18874 Forked child with 18877 Forked child with 18876 Forked child with 18879 Forked child with 18878 Forked child with 18880 Forked child with 18881 ^C ## mce3.pl: caught signal (INT), exiting Killed

Note that the program runs successfully if left to complete:

PID 19017 Forked child with 19019 Forked child with 19020 Forked child with 19023 Forked child with 19022 Forked child with 19024 Forked child with 19021 Forked child with 19019 Forked child with 19020 Forked child with 19022 Forked child with 19023 19020 1491572765.74874 (Child) in END 19019 1491572765.75111 (Child) in END 19024 1491572765.75325 (Child) in END 19022 1491572765.7533 (Child) in END 19021 1491572765.7552 (Child) in END 19023 1491572765.75711 (Child) in END 19017 1491572765.75939 (Parent) in END Parent is ready to dump Dumping: $VAR1 = { '00 19019' => '1491572745.74377', '01 19019' => '1491572746.74401', '02 19019' => '1491572747.74421', '03 19019' => '1491572748.74441', '04 19019' => '1491572749.74457', '05 19019' => '1491572750.74473', '06 19019' => '1491572751.74493', '07 19019' => '1491572752.7451', '08 19019' => '1491572753.74529', '09 19019' => '1491572754.7455', '10 19020' => '1491572745.7436', '11 19020' => '1491572746.74385', '12 19020' => '1491572747.74405', '13 19020' => '1491572748.74427', ... }

Thank you again for the help.


The way forward always starts with a minimal test.

In reply to Re^2: Interrupt multi-process program while using MCE::Shared hash: END block code does not (all) run by 1nickt
in thread Interrupt multi-process program while using MCE::Shared hash: END block code does not (all) run by 1nickt

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.