Hi there, I've written a fairly simple script which reads through one master list line by line and compares entries to other lists in other files, returning essentially a count of matches. The problem is, my comparison lists are rather large (100's of millions total) and each entry needs to run through each one. I have access to a large multi-core server, but I don't know how to modify my code to utilize more processors. I want to do a "work crew" thread model with each thread running a portion of the master list simultaneously and then concatenating the results at the end.
My elementary understanding of this is that I would turn my process into a subroutine with parameters dictating which list entries it will work on, then invoking new threads with the threads module to handle all sections of the master list. Does this sound like the right approach? I just want to know if there are any obvious problems with my plan of attack, or any major things I'm missing since I'm a complete multi-threading newbie.
Also, will perl automatically run these different threads on different cores, or is there something else I need to do to make that happen? I'm running perl on RHEL6 by the way.
In reply to multi threading by egunth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |