No such thing as a small change | |
PerlMonks |
Re: How do you parallelize STDIN for large file processing?by weismat (Friar) |
on Feb 06, 2009 at 05:53 UTC ( [id://741804]=note: print w/replies, xml ) | Need Help?? |
If you want to go the thread way: Create two queues - one for read data and one for write data.(Thread::Queue) Start x workers as detached (I would make this a parameter) and a result writer also detached.(threads) Workers read from the inqueue and send results to the result queue. Program terminates either when lines read = lines written or when the result queue is empty for x seconds. The main question is the bottleneck, but I have used this approach quite frequently on multicore machines with success.
In Section
Seekers of Perl Wisdom
|
|