Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

笔误,TRSM 修改为 TSRM #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

## Thread-Safe Data Pools(线程安全的资源池?)

在扩展的Module Init里,扩展可以调用ts_allocate_id()来告诉TRSM自己需要多少资源
TRSM接收后更新系统使用的资源,并得到一个指向刚分配的那份资源的id。
在扩展的Module Init里,扩展可以调用ts_allocate_id()来告诉TSRM自己需要多少资源
TSRM接收后更新系统使用的资源,并得到一个指向刚分配的那份资源的id。

````c
typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion 4.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ p = strchr(str, ',');
````
现在所有的问题都水落石出了,字符串变量str没有以NULL结尾,而我们却把它当作一个参数传给了二进制不安全的字符串处理函数,str将会扫描str知道找到NULL为止,它的扫描肯定是越界了,然后引发了一个段错误。找到问题根源后,我们只要用memchr来替换strchr函数就能修复这个bug了。
### --enable-maintainer-zts
第二个重要的参数便是激活php的线程安全机制(Thread Safe Resource Manager(TSRM)/Zend Thread Safety(ZTS)),使我们开发出的程序是线程安全的。对于TRSM的介绍大家可以参考第一章的介绍,在平时的开发中,建议打开这个选项。
第二个重要的参数便是激活php的线程安全机制(Thread Safe Resource Manager(TSRM)/Zend Thread Safety(ZTS)),使我们开发出的程序是线程安全的。对于TSRM的介绍大家可以参考第一章的介绍,在平时的开发中,建议打开这个选项。
### --enable-embed
其实还有一个选项比较重要,那就是enable-embed,它主要用在你做php的嵌入式开发的场景中。平时我们把php作为apache的一个module进行编译,得到libphp5.so,而这个选项便使php编译后得到一个与我们设定的SAPI相对应的结果。

Expand Down