Don't ask to ask, just ask | |
PerlMonks |
Re^4: Interrupt multi-process program while using MCE::Shared hash: END block code does not (all) runby Anonymous Monk |
on Apr 07, 2017 at 20:38 UTC ( [id://1187427]=note: print w/replies, xml ) | Need Help?? |
Thanks 1nickt. Regarding the use of the END block, no problem and why not use it. MCE::Signal is the reason for why the END block is not called for the parent process. It ends up doing a KILL signal. Fortunately, one can disable that by loading MCE::Signal before other MCE modules and pass the -no_kill9 option. Now that the END block is working, the handlers for the parent process are no longer needed. Nor the TERM handler for MCE workers. The script now looks like this. Regarding shared objects, having OO and auto-dereferencing on the fly makes it so natural versus calling tied(%hash)->method.
I will test the change to MCE::Shared::Server. It's not feasible to handle both situations I'm not sure. However, it seems important for the shared-server to stick around longer to handle requests made inside handlers and END blocks.
It sure is nice to have the END block working. But it requires loading MCE::Signal qw( -no_kill9 ) before MCE modules to take effect. Signal handling is not fun. Likewise, parallel programming is crazy. But, with your help 1nickt, it's almost there. We're on the road. Amazingly Wifi from the laptop via the phone is working well. Thank you, 1nickt. Thank you, Perlmonks.
In Section
Seekers of Perl Wisdom
|
|