Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How do you parallelize STDIN for large file processing?

by weismat (Friar)
on Feb 06, 2009 at 05:53 UTC ( #741804=note: print w/ replies, xml ) Need Help??


in reply to How do you parallelize STDIN for large file processing?

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.


Comment on Re: How do you parallelize STDIN for large file processing?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://741804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-07-24 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls