in reply to How do you parallelize STDIN for large file processing?
That of course means you can't take data strictly from STDIN, but really that's a silly way to process 4.1GB of data!
If you really, really need to read it from a stream and output it in-order then you'll have to have a parent reading the stream, forking kids and then collecting the results in buffers so you can output in-order. Start with Parallel::ForkManager, which will handle giving out the work and then mix in some IO::Pipe and IO::Select for collecting the results. Be sure you divide the work into sizable chunks, forking a new child for each line isn't going to help very much!
Now go give it a try and don't come back until you have some code to post!
-sam
|
---|