bebe has asked for the wisdom of the Perl Monks concerning the following question:
Hi I'm trying to share an array of arrays between threads and I have no luck with that.
sub make_shared_array {
my $a = &share([]);
for (my $i = 0;$i < $ARRAY_SIZE;++$i) {
my $row = &share([]);
$a->[$i] = $row;
}
return $a;
}
sub abc {
push(@{$X[$var1]}, $Var2);
}
This is what I'm hoping to print:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sharing array of arrays between threads
by aitap (Curate) on Aug 10, 2012 at 07:56 UTC | |
by bebe (Novice) on Aug 10, 2012 at 23:32 UTC | |
by aitap (Curate) on Aug 11, 2012 at 08:25 UTC | |
|
Re: sharing array of arrays between threads
by kcott (Archbishop) on Aug 10, 2012 at 09:22 UTC | |
by BrowserUk (Patriarch) on Aug 10, 2012 at 09:42 UTC | |
by kcott (Archbishop) on Aug 10, 2012 at 10:23 UTC | |
by bebe (Novice) on Aug 10, 2012 at 23:51 UTC | |
|
Re: sharing array of arrays between threads
by rohit_raghu (Acolyte) on Aug 10, 2012 at 07:05 UTC |