<?
set_time_limit(0);
while(1){
$thCount = exec("ps a | nasimke.php | wc -l");
echo $thCount."\r\n";
if($thCount < 10) {
for($i = 0; $i < 20; $i++){
echo "launch thread\r\n";
passthru("(php -f nasimke.php & ) >> /dev/null 2>&1");
//sleep(1);
}
} else {
sleep(5);
}
}