CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [Sam Kennedy] Thread or Fork?: Edit Log



FishMonger
Veteran / Moderator

Aug 29, 2012, 2:29 PM


Views: 6018
Re: [Sam Kennedy] Thread or Fork?


Quote
it hasn't worked

That's a very poor problem statement.

In what way does it not work?

What does it do that you didn't expect and how does that differ from what you expected?

What thread module(s) are you using?


Quote

Code
${"thr".$i} = new Thread \&pixel_comparison, $i;


Ouch! Why are you using a symbolic reference?

Doing that tells me that you're not using the strict pragma, which is a mistake. Instead of the symbolic reference, you should be using a hash or an array.

Also, it's best to not use the indirect object call. That statement should more like this:

Code
$thread[$i] = Thread->new(\&pixel_comparison, $i);



(This post was edited by FishMonger on Aug 29, 2012, 2:30 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Aug 29, 2012, 2:30 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives