[TriLUG] Perl and SMP

Michael Tharp gxti at partiallystapled.com
Mon Jun 4 14:54:15 EDT 2007


Andrew Perrin wrote:
> I fear I know the answer to this already, but...
>
> is there any way to get perl to use the multiple processors on an SMP 
> machine (running linux, of course), short of fork()ing distinct processes? 
> I've got a text processing program chugging along on one processor with 
> three more sitting there idle, and it would be nice to see it Just Work 
> (tm) by using all four. But it's not worth rewriting the program to fork 
> into separate threads.
>   
You've already exhausted your only two choices: either spawn threads 
(Perl threading), or spawn processes (fork). You can't make a single 
thread use more than one processor.



More information about the TriLUG mailing list