Problems? Is your data what you think it is? | |
PerlMonks |
Re^8: Interrupt multi-process program while using MCE::Shared hash: END block code does not (all) runby 1nickt (Canon) |
on Apr 09, 2017 at 19:56 UTC ( [id://1187535]=note: print w/replies, xml ) | Need Help?? |
Hi ++marioroy, That's very cool. Now when one of the workers encounters a fatal exception the whole program ends. But, of course, one has no guarantee of which tasks might have been completed (especially in a real-world scenario where task execution time varies and there are more than just two workers). So even with the program exiting via __DIE__, one can easily wind up with not only a partially populated hash/cache (as expected on early exit), but a hash partially populated *out of sequence* compared to the array being processed by mce_loop. E.g.: That was of course completely foreseeable, but I hadn't thought about it when asking for default DIE behaviour. Now, since it makes no difference in terms of the issue I first thought of (patchy-incomplete results), I think I may be more likely to favour the previous behaviour; in other words, continue processing even when one worker dies unexpectedly. Haha, sorry! Well, I think both choices are valuable and most needed, actually. Thanks again.
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|