Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-13 Thread Steph Fox
y Stogov" <[EMAIL PROTECTED]> To: "'Steph Fox'" <[EMAIL PROTECTED]>; "'Stanislav Malyshev'" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 13, 2006 3:22 PM Subject: RE: [PHP-DEV] Re: [PATCH] Automatic module globals management > Step

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-13 Thread Dmitry Stogov
> -Original Message- > From: Steph Fox [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 13, 2006 6:24 PM > To: Dmitry Stogov; 'Stanislav Malyshev' > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management >

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-13 Thread Steph Fox
sage - From: "Dmitry Stogov" <[EMAIL PROTECTED]> To: "'Steph Fox'" <[EMAIL PROTECTED]>; "'Stanislav Malyshev'" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 13, 2006 3:22 PM Subject: RE: [PHP-DEV] Re: [PATCH] Automatic modul

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-13 Thread Dmitry Stogov
itry. > -Original Message- > From: Steph Fox [mailto:[EMAIL PROTECTED] > Sent: Sunday, June 11, 2006 12:49 PM > To: Stanislav Malyshev > Cc: Dmitry Stogov; internals@lists.php.net > Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management > > > Hi

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-11 Thread Steph Fox
Hi Stas SF>>resource id, and it would need to be a ZTS build. Whatever way you look at SF>>it, that's a screwed up configuration. So we would blame the user for our broken code. Do you think it's a good idea. No I don't, so I wrote something completely different. Is the attached a better s

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-11 Thread Stanislav Malyshev
SF>>You'd need to be _dynamically_ loading somewhere over 24 modules for that to SF>>happen, and this is me testing with a --disable-all build. Normally it'd be So what? What is so special in number 24 that it can never happen? 640K of memory is enough for everybody, right? That's exactly what I

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-11 Thread Stanislav Malyshev
SF>>Erm, Stas, it's not because it's impossible - it's because that SF>>module_shutdown_func happens to be the module's MSHUTDOWN. The contents of SF>>MSHUTDOWN generally look something like: SF>> SF>>#ifdef ZTS SF>>ts_free_id(pcre_globals_id); SF>>#else SF>>php_pcre_shutdown_globals(&pcre_globals

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
SF>>How is it going to be dependent in any way on a module that was loaded SF>>after it was?! As far as understand the code, table_size - zend_dl_module_count() formula starts with last allocated ID and deallocates one ID per module unloaded, starting from the latest loaded module. However, if th

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
SF>>Because we need to work through one resource at a time from the top, SF>>and because dl'd modules are the last things with a resource id to be SF>>loaded, because they have to be. As you see belowe, this is not correct. SF>>You got me there. OK, I didn't know that happens until just now. The

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Stanislav Malyshev
SF>>How is it going to be dependent in any way on a module that was loaded SF>>after it was?! As far as understand the code, table_size - zend_dl_module_count() formula starts with last allocated ID and deallocates one ID per module unloaded, starting from the latest loaded module. However, if

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Stanislav Malyshev
SF>>Because we need to work through one resource at a time from the top, SF>>and because dl'd modules are the last things with a resource id to be SF>>loaded, because they have to be. As you see belowe, this is not correct. SF>>You got me there. OK, I didn't know that happens until just now. Th

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
My comments went something along the lines of 'well if it's going in can we please apply a fix for the problem this was supposed to fix in the first place, because it isn't an answer to that problem'. I'd still personally rather it didn't, but I'm happy so long as we get an actual fix in there

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
SF>>crash might well appear random.) The best way to deal with an extension SF>>declaring more than one thread resource would be to build it as static. But That's a good advice but not practical at all. :) Static extensions can not be distributed as a product or a package, for example. And as

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
SF>>The number of the final TSRM resource id that was loaded will be the SF>>size of the table they're stored in, plus one (to keep life simple). SF>>So we pick up that figure and call it 'table_size'. Then we subtract SF>>the number of modules registered in the dl_module_count. I'm not sure wh

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Ilia Alshanetsky
You're right, Steph's comments threw me off a bit there, but after reconsidering the patch in detail I think it should be fine for 5.2, so go ahead and commit it. On 8-Jun-06, at 7:44 PM, Andi Gutmans wrote: Why so? It doesn't affect any compatibility. At 02:31 PM 6/8/2006, Ilia Alshanets

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Stanislav Malyshev
SF>>crash might well appear random.) The best way to deal with an extension SF>>declaring more than one thread resource would be to build it as static. But That's a good advice but not practical at all. :) Static extensions can not be distributed as a product or a package, for example. SF>>being

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Stanislav Malyshev
SF>>The number of the final TSRM resource id that was loaded will be the SF>>size of the table they're stored in, plus one (to keep life simple). SF>>So we pick up that figure and call it 'table_size'. Then we subtract SF>>the number of modules registered in the dl_module_count. I'm not sure wh

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
-related. Thanks. Dmitry. -Original Message- From: Steph Fox [mailto:[EMAIL PROTECTED] 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

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Dmitry Stogov
9, 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 - >

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
Friday, June 09, 2006 11:42 AM Subject: RE: [PHP-DEV] Re: [PATCH] Automatic module globals management I also think that Steph's patch is to magic. :) Dmitry. -Original Message- From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 12:28 PM To: Steph Fox

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
Hi Stas, SF>>Attached are patches for fixing the win32/ZTS thing only when needed - 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_c

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Dmitry Stogov
I also think that Steph's patch is to magic. :) Dmitry. > -Original Message- > From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] > Sent: Friday, June 09, 2006 12:28 PM > To: Steph Fox > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Re: [PATCH] A

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Stanislav Malyshev
SF>>Attached are patches for fixing the win32/ZTS thing only when needed - 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());

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Derick Rethans
On Fri, 9 Jun 2006, Dmitry Stogov wrote: > I will rework patch with new names (GINIT/GSHUTDOWN as Sara suggested) and > commit it into HEAD today or at Thursday. > According to PHP_5_2 we probably will need voting. I'm -1 on integrating it into 5.2 then. regards, Derick -- Derick Rethans http:/

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
al Message - From: "Dmitry Stogov" <[EMAIL PROTECTED]> To: "'Steph Fox'" <[EMAIL PROTECTED]>; "'Ilia Alshanetsky'" <[EMAIL PROTECTED]>; "'Andi Gutmans'" <[EMAIL PROTECTED]> Cc: Sent: Friday, June 09, 20

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Steph Fox
HEAD? I'm hoping it'll separate the issues of API redesign vs bugfix... - Steph - Original Message - From: "Dmitry Stogov" <[EMAIL PROTECTED]> To: "'Steph Fox'" <[EMAIL PROTECTED]>; "'Ilia Alshanetsky'" <[EMAIL P

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Dmitry Stogov
2006 4:09 AM > To: internals@lists.php.net; Pierre > Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management > > > On Thu, 8 Jun 2006 23:34:10 +0200 > [EMAIL PROTECTED] (Pierre) wrote: > > > On 6/8/06, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote:

RE: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-09 Thread Dmitry Stogov
odule globals, and never call them directly. Thanks. Dmitry. > -Original Message- > From: Steph Fox [mailto:[EMAIL PROTECTED] > Sent: Friday, June 09, 2006 7:23 AM > To: Ilia Alshanetsky; Dmitry Stogov; Andi Gutmans > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
Andi, Why so? It doesn't affect any compatibility. Yes it does, and more particularly it prevents any fix for the win32/ZTS issue until people upgrade to the new module API. If everyone has to add an extra #ifdef into MSHUTDOWN to get around the new situation, but then has to take it away a

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Pierre
On Thu, 8 Jun 2006 23:34:10 +0200 [EMAIL PROTECTED] (Pierre) wrote: > On 6/8/06, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: > > The patch is good, but I think this change maybe a bit too extreme > > for PHP 5.2 > > I agree. As far as I remember, we even discussed a similar solution > some years

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Andi Gutmans
Why so? It doesn't affect any compatibility. At 02:31 PM 6/8/2006, Ilia Alshanetsky wrote: The patch is good, but I think this change maybe a bit too extreme for PHP 5.2 On 8-Jun-06, at 8:15 AM, Dmitry Stogov wrote: Hi, The attached patch (for PHP_5_2) implements automatic management of mod

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Pierre
On 6/8/06, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: The patch is good, but I think this change maybe a bit too extreme for PHP 5.2 I agree. As far as I remember, we even discussed a similar solution some years ago and decided to delay it until someone comes with a better one, which indeed di

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Ilia Alshanetsky
The patch is good, but I think this change maybe a bit too extreme for PHP 5.2 On 8-Jun-06, at 8:15 AM, Dmitry Stogov wrote: Hi, The attached patch (for PHP_5_2) implements automatic management of module globals. The problem that module globals must be unregistered before extension unloa

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Derick Rethans
On Thu, 8 Jun 2006, Steph Fox wrote: > People with custom extensions at least are only working with one version of > PHP at a time, I'd hope :) Are you kidding? There are people using Xdebug for PHP 4.3.x, 4.4.x, 5.0.x, 5.1.x and 5.2.x... that's already enough headaches to maintain with ifdefs

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Andi Gutmans
At 11:33 AM 6/8/2006, Steph Fox wrote: It's not going to be a headache because they can still use it the way it should be done today. ... for the last two months or so... that's not a 'should', that's a workaround. For the 5.1.x tree you can do the fixes immediately with the way Dmitry has

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Pierre
On 6/8/06, Steph Fox <[EMAIL PROTECTED]> wrote: People with custom extensions at least are only working with one version of PHP at a time, I'd hope :) Not really. Especially not when you provide it as a product. --Pierre -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe,

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
It's not going to be a headache because they can still use it the way it should be done today. ... for the last two months or so... that's not a 'should', that's a workaround. For the 5.1.x tree you can do the fixes immediately with the way Dmitry has previously proposed Huh? Did I mi

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
Hi Rasmus, It'd make more sense to apply the patch partially in 5_2 and change the module API number (to address that issue and give extension authors some hope of understanding what's going on), and apply the whole thing in HEAD and bump the API number again. I really think applying it in 5_2

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Andi Gutmans
It's not going to be a headache because they can still use it the way it should be done today. For the 5.1.x tree you can do the fixes immediately with the way Dmitry has previously proposed At 11:18 AM 6/8/2006, Steph Fox wrote: Andi, hi, I read the whole thread. I agree with Sara. Whi

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Rasmus Lerdorf
Steph Fox wrote: Andi, hi, I read the whole thread. I agree with Sara. While I understand where Steph is coming from, I still think this is a good change. It would allow us to use this method in the current tree right away, and for PECL authors who want to stay compatible with older version

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
Andi, hi, I read the whole thread. I agree with Sara. While I understand where Steph is coming from, I still think this is a good change. It would allow us to use this method in the current tree right away, and for PECL authors who want to stay compatible with older versions they can use the

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Andi Gutmans
I read the whole thread. I agree with Sara. While I understand where Steph is coming from, I still think this is a good change. It would allow us to use this method in the current tree right away, and for PECL authors who want to stay compatible with older versions they can use the old & ugly

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
I'm sorry Steph, I know your position, but I just don't understand it. This is a minor gain at no cost. Minor enough that it's not worth it to me to fight with you over it, but no-cost enough to compel me to against my better judgement... :) That's because you're missing that this was origina

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Sara Golemon
For the modules which are part of the core distribution this is a non-issue as they're branched. For PECL modules this is the same "how old of a PHP version am I (as the package maintainer) willing to support?". That package maintainer can: (A) Not use the new API, (B) Wrap up some #ifdef's, o

Re: [PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
Yes, I know. But altered modules won't be able to use older versions of PHP readily, and that's going to be a real problem in PECL - especially if this goes into 5_2 branch. For the modules which are part of the core distribution this is a non-issue as they're branched. For PECL modules this

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Sara Golemon
Yes, I know. But altered modules won't be able to use older versions of PHP readily, and that's going to be a real problem in PECL - especially if this goes into 5_2 branch. For the modules which are part of the core distribution this is a non-issue as they're branched. For PECL modules this

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Steph Fox
Hi Sara, I think you're missing the fact that Dmitry's patch only *enables* an extension to register CTOR/DTORs in the module entry struct. Existing modules can continue to use the manual calls in MINIT/MSHUTDOWN without breaking. Yes, I know. But altered modules won't be able to use older

[PHP-DEV] Re: [PATCH] Automatic module globals management

2006-06-08 Thread Sara Golemon
The attached patch (for PHP_5_2) implements automatic management of module globals. The problem that module globals must be unregistered before extension unloading, because "globls_dtor" function is unloaded together with extension and cannot be called. Dmitry- I like the concept especially as