Re: Re: [PATCH] Automatic module globals management
| From: | Steph Fox | Date: | Fri, 09 Jun 2006 14:40:05 +0000 |
| Subject: | Re: Re: [PATCH] Automatic module globals management | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24039@lists.php.net to get a copy of this message | ||
Hi :)
Who said that 1,2,3,... should work?Erm, it does...
What will your patch do if some extension will register several tsrm ids?If an extension has several tsrm ids and it's loaded as a shared module, it will probably crash on shutdown unless the author adds the appropriate ts_free_id() calls in MSHUTDOWN - depending on the number of shared extensions loaded, the load order in the php.ini, on the nature of the modules unloading before it, and on how many tsrm ids it declares. (That crash might well appear random.) The best way to deal with an extension declaring more than one thread resource would be to build it as static. But it actually wouldn't be any worse off than currently, because it would already need to have ts_free_id() calls coming out of its ears to work as shared at all, this side of 5.1.3.
What will it do if some extension will not register globals?That's the situation already with gd... Remember only dl'd modules _request_ their resources freed in this way - the other 20-odd resource 'owners' in the core either wait until tsrm_shutdown(), or make an independant call to ts_free_id(), or else are freed slightly early because of something like gd being in the DL_UNLOAD queue. It doesn't matter when that happens - the unload order isn't changed, the same resource id can't be freed twice, and all the other actions within the module_destructor are module-related rather than TSRM-related.
Thanks. Dmitry.-----Original Message----- From: Steph Fox [mailto:steph@zend.com] Sent: Friday, June 09, 2006 2:17 PM To: Dmitry Stogov; 'Stanislav Malyshev' Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management What's 'magic' about going 1, 2, 3, 4....? ----- Original Message ----- From: "Dmitry Stogov" <dmitry@zend.com> To: "'Stanislav Malyshev'" <stas@zend.com>; "'Steph Fox'" <steph@zend.com> Cc: <internals@lists.php.net> Sent: Friday, June 09, 2006 11:42 AM Subject: RE: [PHP-DEV] Re: [PATCH] Automatic module globals managementI also think that Steph's patch is to magic. :) Dmitry.-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.comglobals management-----Original Message----- From: Stanislav Malyshev [mailto:stas@zend.com] Sent: Friday, June 09, 2006 12:28 PM To: Steph Fox Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Re: [PATCH] Automatic moduleSF>>Attached are patches for fixing the win32/ZTS thing only when needed SF>>- SF>>this will _only_ work if you apply Dmitry's patch to 5_2 as well. The SF>>idea being that this way everybody's covered. I'm not sure I understand what this line does: ts_free_id(table_size - zend_dl_module_count()); Can you explain? -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php__________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com