more useful options | |
PerlMonks |
Re^4: How to split file for threading?by marioroy (Prior) |
on Jun 26, 2015 at 17:22 UTC ( [id://1132189]=note: print w/replies, xml ) | Need Help?? |
Update: Added chunk_size option to the example. Update: Added note on one worker reading at any given time. The example by BrowserUk is awesome. Perhaps you're having to work with Perl not compiled with threads; e.g. running Perl on Solaris. A pattern counter can be done with MCE using the following code. The usage is the same between the two scripts. This is safe from random I/O thrashing. The read pattern is sequential, not random between workers due to one worker reading at any given time.
Usage:
In Section
Seekers of Perl Wisdom
|
|