On Tue, Oct 21, 2008 at 6:51 PM, Ben Scott <[EMAIL PROTECTED]> wrote: >> Perl is poor at SMP (gah! perl threads!). > I've never had to worry about Perl MP. Sounds like I should be glad. :-)
MP in any language is tricky, but sometimes it appears easy and bites you later. Perl has tried a couple times to make it safe and easy, but MP intrinsically isn't, so the original Perl Threads (5.005) design was abandoned. The heavierweight interpreter threads (ithreads) used for fork() emulation on MSWindows since 5.6 has been available as a config choice when building Perl for nomal platforms since 5.8. IBM ships /bin/perl with ithreads enabled on AIX. I am pleasantly surprised none of my coworkers have hurt themselves with raceconditions. Shell pipes are a simple coarse MP primitive that *is* safe, but at the cost of spawning heavyweight processes and flowing through IPCs. A shell pipe with sort in it won't be doing more than loading the executable / spawning the process in parallel, since the sort won't write until it's done reading. Shell scripts with bunches of external commands in the inner loop will speed up in Perl as, even with sticky execs, each external commands line execution costs a process start. 7Perl scripts are much faster if one uses the built-in bulk processing features (the Lisp or APL 'map-reduce' dialect of Perl) rather than writing the same thing in Perl loops and branches (the C dialect). But it won't my knowledge make use of SIMD/SMP (although that has been added to one of the Perl 6 prototypes). -- Bill [EMAIL PROTECTED] [EMAIL PROTECTED] _______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/