On Wed, Feb 13, 2019 at 9:26 AM Dmitry Stogov <dmi...@zend.com> wrote:
> Hi, > > > After JIT+ZTS related discussion with Joe and Bob, and some related > analyzes. > > I came to more or less formed design idea and described it at > https://wiki.php.net/zts-improvement > > This is not an RFC and I'm not sure, if I like to implement TSRM changes > myself now. > > > Comments are welcome. > Hi Dmitry, Thanks for looking into this issue. As a possible alternative I would like to suggest the use of ZEND_TLS (__thread) for the EG/CG/BG etc globals on Linux (on Windows this is not possible due to DLL linkage restrictions). __thread generates very good code (single load over %fs segment with constant address) if the global is defined and used in an executable. I'm not sure what kind of code it generates when TLS is declared in an executable and used in a shared object, but as direct access from extensions to the engine globals shouldn't be common, it's probably okay even if it uses __tls_get_addr. Nikita