2011-06-05 63 views

回答

1

其实,有使用了pcntl功能,特别是pcntl_fork()将是你的朋友对这个..

你可以找到许多this page代码示例。

简单的例子:

$pid = pcntl_fork(); 

if($pid) { 
    // parent process runs what is here 
    print "parent\n"; 
} 
else { 
    // child process runs what is here 
    print "child\n"; 
} 


// outputs: 

child 
parent 

这很简单,因为它得到,在现实生活中,你有更多的检查比这个,你看一下了pcntl节上php.net和我发布的网页上的代码示例很少。希望能让你走上正轨,开心编码。

相关问题