首页 >后端开发 >php教程 >php popen兑现多任务

php popen兑现多任务

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-13 10:49:25881浏览

php popen实现多任务

<?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 2>&1';$t1 = microtime(1);for($i = 0 ; $i 


<?phpsleep (2);$fp = fopen('doit.txt','a');fwrite($fp,$argv[1]."\n");fclose($fp);exit(0);?>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn