Phppopen supports multiple tasks. Php code? Php $ update_num1000; $ limit100; $ p_num0; $ line_cmdps-ef | grepdoit. php | grep-vgrep | wc-l; $ exec_cmdusrlocalphpbinphpdoit.php % sdevnull21; Php code
$ Update_num = 1000;
$ Limit = 100;
$ P_num = 0;
$ Line_cmd = 'PS-ef | grep doit. php | grep-v grep | wc-l ';
$ Exec_cmd = '/usr/local/php/bin/php doit. php % s &>/dev/null 2> & 1 ';
$ T1 = microtime (1 );
For ($ I = 0; $ I <$ update_num; $ I ++ ){
If ($ p_num <= 0 ){
$ Fp1 = popen ($ line_cmd, 'r ');
// Current shell process numbers
$ Line = fread ($ fp1, 512 );
Pclose ($ fp1 );
// Processes can be pushed
$ P_num = $ limit-$ line;
If ($ p_num <= 0 ){
Usleep (100 );
}
}
$ P_num = $ p_num-1;
$ Cmd = sprintf ($ exec_cmd, $ I );
$ Fp = popen ($ cmd, 'r ');
Pclose ($ fp );
}
$ T2 = microtime (1 );
Echo round ($ t2-$ t1, 2 );
?>
Php code
Sleep (2 );
$ Fp = fopen('doit.txt ', 'A ');
Fwrite ($ fp, $ argv [1]. "\ n ");
Fclose ($ fp );
Exit (0 );
?> Fblww-0227)
From Network Marketing
Why? Php $ update_num = 1000; $ limit = 100; $ p_num = 0; $ line_cmd = ps-ef | grep doit. php | grep-v grep | wc-l; $ exec_cmd =/usr/local/php/bin/php doit. php % s/dev/null 21 ;...