good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^7: shared scalar freed earlyby marioroy (Prior) |
on Mar 08, 2017 at 21:02 UTC ( [id://1183971]=note: print w/replies, xml ) | Need Help?? |
Below, an example using MCE::Flow. It chunks and outputs swiftly. The relay option when defined loads MCE::Relay and with that enables relay capabilities. Relay is beneficial in places where workers must run orderly and serially. Only a single worker can run inside the relay block. The important thing is that workers enter it orderly by "chunk id" value. If threads is desired on a Unix platform, simply load threads prior to loading MCE. By default, MCE spawns threads if present. Unlike MCE.pm where chunk_size defaults to 1, chunk_size is configured automatically for MCE models.
Cheers, Mario.
In Section
Seekers of Perl Wisdom
|
|