Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.c
| From: | Thies C. Arntzen | Date: | Wed, 04 Jun 2003 13:39:43 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.c | ||
| References: | 1 2 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1334@lists.php.net to get a copy of this message | ||
sOn Wed, Jun 04, 2003 at 04:25:50PM +0300, Stanislav Malyshev wrote:
> TCA>> > Why?
> TCA>>
> TCA>> i might me wrong but only mallocing the
> TCA>> GLOBAL_CONSTANTS_TABLE in ZTS mode atleast looks bogous. but
> TCA>> -again- i haven't looked at the code.
>
> If you did, you'd see that non-ZTS branch calls zend_startup_constants
> which malloc's EG(zend_constants). Now, CG(zend_constants) doesn't exist
> at all in non-ZTS, neither does GLOBAL_CONSTANTS_TABLE have any meaning
> besides being the same as EG(zend_constants). The difference between ZTS
> and non-ZTS here is that thread-local EG(zend_constants) must be
> hand-initialized from master-thread global_constants_table, while non-ZTS
> locals are automatically created as a copies of EG(zend_constants) by the
> fork magic and need not to be re-constructed.
i trust you;-) but - after looking thru zend.c - i think that
the TLS stuff is getting more and more un-maintainable.
i see no reason why we can't do the ZTS stuff always like:
static void php_bla_init_globals(php_bla_globals *bla_globals_p TSRMLS_DC)
{
bla_globals_p->bla_thread_local = 0;
}
PHP_MINIT_FUNCTION(bla)
{
bla_real_global = "initialized here";
#iffdef ZTS
ts_allocate_id(&bla_globals_id, sizeof(php_bla_globals), (ts_allocate_ctor)
php_bla_init_globals, NULL);
#else
php_bla_init_globals(&bla_globals TSRMLS_CC);
#endif
as this would be so much easier to maintain and understand... yes - i know -
that we don't have a PHP_MINIT_FUNCTION in Zend/* - but you can still see my
point? just search for ZTS in zend.c and you'll see that the ZTS stuff has
become very messy.
re,
tc