您好,欢迎访问一九零五行业门户网

PHP的线程库:pthreads

该项目为 php 提供基于 posix 的多线程编程机制。可异步执行任何与定义的用户自定义方法和函数。内建支持同步和同步方法。
亮点一个易于使用,快速学习的 threading api for php5.3+execute any and all predefined and user declared methods and functions asynchronouslyready made synchronization included, geared towards the php environmentseamless operation in multi-threaded sapi environmentsa world of possibilities ...技术特性posix threadssynchronizationworker threadssynchronized methodscomplete support for oo - ie. traits, interfaces, inheritancefull read/write/execute support for threaded objectsmutex ( direct, subset )conditions ( direct, subset )pthreads was written with simplicity, compatibility and efficiency in mind, it's performance beggars belief !!
环境要求
php5.3+zts enabled ( thread safety )posix threads implementationtesting has been carried out on x86, x64 and arm, in general you just need a compiler and pthread.h
php 版本支持pthreads should compile and work in any version of php from 5.3.0 to the latest release.
示例代码:
arg = $arg; } public function run(){ if($this->arg){ printf(hello %s\n, $this->arg); } }}$thread = new asyncoperation(world);if($thread->start()) $thread->join();?>
复制代码
项目主页:http://www.open-open.com/lib/view/home/1391824675848
其它类似信息

推荐信息