rfc:tls
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:tls [2008/08/26 14:28] – . lbarnaud | rfc:tls [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Status: Under Discussion | * Status: Under Discussion | ||
* First Published at: http:// | * First Published at: http:// | ||
- | * Initial patch: http://arnaud.lb.s3.amazonaws.com/__thread-tls.patch | + | * Initial patch: http://gist.github.com/659731 |
- | * Current patch: http://arnaud.lb.s3.amazonaws.com/__thread-tls-2.patch | + | * Current patch: http://gist.github.com/659724 |
Currently ZTS builds are slower than non-ZTS builds. This RFC is about avoiding some of the major overhead of ZTS builds by using native thread local storage. | Currently ZTS builds are slower than non-ZTS builds. This RFC is about avoiding some of the major overhead of ZTS builds by using native thread local storage. | ||
Line 34: | Line 34: | ||
Unfortunately the TLS model used in these tests was the static model, which is restrictive, | Unfortunately the TLS model used in these tests was the static model, which is restrictive, | ||
- | For the PHP module to be able to be loaded at runtime in Apache or an other server with this patch enabled, it has to be built with the static | + | For the PHP module to be able to be loaded at runtime in Apache or an other server with this patch enabled, it has to be built with the dynamic |
Native TLS can be enabled with %%--with-tsrm-__thread-tls%% or %%--with-tsrm-full__thread-tls%%. The last declares globals statically instead of making them pointers. | Native TLS can be enabled with %%--with-tsrm-__thread-tls%% or %%--with-tsrm-full__thread-tls%%. The last declares globals statically instead of making them pointers. | ||
Line 91: | Line 91: | ||
===== Windows ===== | ===== Windows ===== | ||
- | Dynamically loaded DLLs can use TLS starting with Windows Vista and Server 2008. But there is a restriction: | + | Dynamically loaded DLLs can use TLS starting with Windows Vista and Server 2008. But there is a restriction: |
===== TLS internals ===== | ===== TLS internals ===== | ||
Line 165: | Line 165: | ||
As the patch avoids passing tsrm_ls across function calls, #ifdef ZTS is not anymore relevant to check that. | As the patch avoids passing tsrm_ls across function calls, #ifdef ZTS is not anymore relevant to check that. | ||
The new PASS_TSRMLS macro is now defined when tsrm_ls needs to be passed across function calls. For instance this is needed by ZEND_ATTRIBUTE_FORMAT and some other places. | The new PASS_TSRMLS macro is now defined when tsrm_ls needs to be passed across function calls. For instance this is needed by ZEND_ATTRIBUTE_FORMAT and some other places. | ||
- |
rfc/tls.1219760920.txt.gz · Last modified: 2017/09/22 13:28 (external edit)