I would strongly recommend Programming Perl, Third Edition. The
chapter on using Thread.pm (Chapt. 17 I think) is extremely useful and
will give you a good idea of how to build a multi-threaded Perl
application (and how NOT to build one). Parallelism can be difficult.
A new edition is rumoured to be coming out this October from O'Reilly,
so you can always read the old one online before you buy the new one.
Note that if you plan on doing multithreading, you'll need to make
sure Perl is compiled with the multithreading option. I am not sure
this is the case with ActiveState Perl, best to check it first. If
Thread.pm is in the install libs, multithreading should be active.
IF you have mutlithreading enabled, fork() is kind of a poor man's
Thread.pm - with a huge caveat. fork() builds processes, not threads,
which have a far higher overhead. But, with multithreading enabled,
parallel tasks can be accomplished with fork(). In fact, if you've
ever used system(), you've already used fork() - because system() is
basically just calling fork() and exec().
A search on perlmonks.org for fork() or Thread.pm will bring up all
kinds of goodness. Remember - fork() is parallel, but not real
threading. It can and will become hugely inefficient very quickly if
incorrectly used.

--Aaron

On Tue, Aug 23, 2011 at 4:16 PM, Greg Aiken <gai...@visioninfosoft.com> wrote:
> in light of the fact that most recent Intel processors offer 'multiple'
> cores...
>
> if one had a problem to solve that could be broken down to serial vs
> 'parallel' processes
>
> 1. is there a way using Perl, where one could intentionally take advantage
> of, and explicitly solve a problem by using this cpu parallelism, to send
> one task to one core and another to a 2nd (or more) core?
>
> 2. if so, is there an EASY way to do this?  can anyone suggest a tutorial
> page?
>
> thanks,
>
> Greg
>
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to