J'ai un CGI qui appelle trois threads :
$thr1 = threads->new(\&sub1, "linux");
$thr2 = threads->new(\&sub1, "bsd");
$thr3 = threads->new(\&sub1, "windows");
Ensuite, je fais en sorte d'attendre les threads :
$data1 = $thr1->join;
$data2 = $thr2->join;
$data3 = $thr3->join;
La fonction sub1 est assez stupide :
sub sub1 {
my @Parametres = @_;
return "\"@Parametres\"";
}
Trois fois sur quatre, le script plante lors de l'appel au troisième thread...
Si je rajoute un sleep (5) dans la fonction, par contre, ça (…)
Forum Programmation.perl Threads en Perl dans un CGI
14
sept.
2005