Re: [PATCH] ZTS as fast as non-ZTS
| From: | Stanislav Malyshev | Date: | Mon, 18 Aug 2008 20:26:20 +0000 |
| Subject: | Re: [PATCH] ZTS as fast as non-ZTS | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39998@lists.php.net to get a copy of this message | ||
Hi!
The following patch caches each global address in a native TLS variable so that accessing a global is as simple as global_name->member. This removes the requirement of passing the tls pointer across function calls, so that the two major overheads of ZTS builds are avoided.I think it would be great to use __thread there. But I think if we have working __thread, why not have real globals use it, without all that TSRMG stuff? Having 3 different variants of TSRM support seems excessive. Now, the question is can we reliably detect if we have working __thread - or, in other words, are there compilers which would accept __thread but do not implement it correctly, and can those be identified automatically? If we use static declaration with __thread, then as far as I can see there is no need for separate IDs and all complications following from that.
- Declaring globals statically (--with-tsrm-full-__thread-tls) causes troubles to dlopen(), actually Apache wont load the module at runtime (it works with just --with-tsrm-__thread-tls).What is the problem there, could you elaborate? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com