Subject: | question |
Date: | Mon, 6 Nov 2006 23:10:25 +1100 |
To: | <bug-subs-parallel [...] rt.cpan.org> |
From: | "max" <mtomich [...] optusnet.com.au> |
I have a question related to your statement :
Also, there's no way to tell if a parallelized subroutine is still running or not.
Maybe I didn't understand well but wouldn't be possible to do something like this :
use subs::parallel;%arr={ 1,0, 2,0 };sub foo {
my $me=$_[0];
# do stuff in a loop $arr{$me}=1; return 1
};
sub $bar{
my $me=$_[0];
# do stuff in a loop $arr{$me}=1; return 1};
parallelize_sub('foo');parallelize_sub('bar');foo(1);foo(2);while ( !($arr{'1'}) || !($arr{'2'}) ){ sleep 1; # check every second}print "Done 1 & 2\n";
Kind regards.Max.