At 04:31 PM 9/16/2004 +0300, Stanislav Malyshev wrote:
AD>>I could propose a simple solution: add a global flag, which will indicate
AD>>that shutdown_destructors() was called, and do appropriate check in
AD>>zend_objects_store_del_ref().
AD>>Comments/objections?

I personally don't like the idea of having yet another hack flag.
Moveover, the del_ref is not the only place one may call destructors. What
I'd do is: if one of the dtors bails out, we catch it in call_dtors and
then mark all the objects as "already destroyed" - so there's no way any
dtor could be called after that from any place. This is a bit slower
performance-wise, bnut I'm not sure performance is much of concern in
situation where the code has failed in shutdown - I don't know any "fast
failure" benchmarks ;) After all, it will be not much longer than the
regular shutdown anyway - one pass over the store. The advantage of this
approach is that it follows the existing protocol and not insterts another
flag (read - branch in any function working along the protocol) which
leads to potential breakage.

Yep, that's exactly what I thought.

Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to