Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.c
| From: | Thies C. Arntzen | Date: | Fri, 06 Jun 2003 07:24:13 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.c | ||
| References: | 1 2 3 4 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1343@lists.php.net to get a copy of this message | ||
On Thu, Jun 05, 2003 at 10:27:42PM +0300, Zeev Suraski wrote:
>
> The particular piece of code in zend.c is much trickier. We're
> initializing the infrastructure for making PHP in threaded environments
> tick, and since threaded environments are very different from multiprocess
> environments, there's some extra stuff we have to do. For example, here we
> don't just initialize the current thread's function table. We also
> initialize a process-wide function table, which serves as the read-only
> 'template' for creating new function tables every time a new thread gets
> started (we obviously don't need it in the Apache model, thanks to the
> wonders of fork()).
>
> This is something very much unique to zend.c (there are several cases of
> this happening there) - which is why you see this not-very-pleasant-looking
> piece of code. Have no worries though, as again, it's NOT growing :)
hmm - i have no worries;-) but:
#ifdef ZTS
zend_compiler_globals *compiler_globals;
zend_executor_globals *executor_globals;
void ***tsrm_ls;
#ifdef ZTS
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
...
might be a C&P thing - but it looks awful...
GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable));
#ifdef ZTS
GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable));
#endif
sesame-street (do you get that in israel?) taught me how to "spot the
differnce" but i see none between GLOBAL_FUNCTION_TABLE,
GLOBAL_CLASS_TABLE, GLOBAL_AUTO_GLOBALS_TABLE and GLOBAL_CONSTANTS_TABLE,
do you?
it might be clear to you as the architect of Zend, but for me it's not that
obvious, and if there is a good eplanation for this it would make sense to
name the variables "right"
but -then again- i have no worries.
tc