$pageNum = ceil($totalNum/$pageSize);
for($page=1;$page<=$pageNum;$page++){
    $this->o_pcntl->tps_pcntl_wait('$this->o_cron->doNewMemberSharPage(\''.$page.'\',\''.$pageSize.'\');');//用子进程处理每一页
}


<?php

class o_pcntl extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    public function tps_pcntl_wait($childProcessCode){

        $pid = pcntl_fork();
        if($pid>0){

            pcntl_wait($status);
            @$this->db->reconnect();
        }elseif($pid==0){

            eval($childProcessCode);
            exit;
        }else{
            die('Cannot fork.');
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-05-30
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2022-12-23
  • 2021-10-16
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案