加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP pthreads:Threaded和Stackable之间的区别

发布时间:2020-12-13 16:57:12 所属栏目:PHP教程 来源:网络整理
导读:我很困惑 pthreads PHP扩展中的两个类 Threaded 和Stackable之间有什么区别. PHP手册页没有提到Stackable,但它存在,许多关于pthreads的文章提到了这个类;例如: Recycling Contexts Multi-Threading in PHP with pthreads Easy pthreads Pools 对 get_class_
我很困惑 pthreads PHP扩展中的两个类 Threaded和Stackable之间有什么区别.

PHP手册页没有提到Stackable,但它存在,许多关于pthreads的文章提到了这个类;例如:

> Recycling Contexts
> Multi-Threading in PHP with pthreads
> Easy pthreads Pools

get_class_methods()的调用显示两个类都实现了相同的方法,而get_parent_class()对两者都返回FALSE.

目前我假设Stackable是Threaded的别名.那是对的吗?

解决方法

$stackable = new Stackable;
var_dump(get_class($stackable));

输出:string(8)“Threaded”

看来我的假设是正确的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读