I tried to understand fork. I think that I basically got the
theory behind it, but am far away from practical usage of this
nifty feature. What do I want to achieve? I want to simply harness
the power of SMP machines - just use all the nice BogoMIPS for
computational intensive tasks.
My first shot at it was Parallel::ForkManager:
While this is really great because the loop just takes halfuse Parallel::ForkManager; # Yadda yadda local %hash; $pm = new Parallel::ForkManager(2); # Want use 2 CPUs now (###) foreach $thingy (@so_30_member_list) { my $pid = $pm->start and next; # (###) $hash{$thingy} = &big_heavy_computation_of($thingy); $pm->finish; # Terminates the child process (###) } &look_at_hash;
So now for me to better understand this. I assume, that with
the $pm->start and next a new child is forked with
completedly his own data, thus filling his own instance
of %hash, and then ... well ... just discarding it.
This isnīt actually what I want. How can I get the computer doing
what I want and not what Iīm telling him? :-)
Any help apreciated
Ciao
In reply to FORRRRRK again... by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |