0

php_pthreads扩展

http://www.thinkphp.cn/topic/22676.html

C:\WINDOWS\pthreadVC2.dll


bin\ext\php_pthreads.dll


添加扩展


测试文件:

class AsyncOperation extends \Thread {
    public function __construct($arg){
        $this->arg = $arg;
    }
    public function run(){
        if($this->arg){
            printf("Hello %s\n", $this->arg);
        }
    }
}
$thread = new AsyncOperation("World");
if($thread->start())
    $thread->join();

holyzhang