Re: Problem with ext/libxml RINIT/RSHUTDOWN

From: Date: Fri, 17 Mar 2006 13:59:00 +0000
Subject: Re: Problem with ext/libxml RINIT/RSHUTDOWN
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-22505@lists.php.net to get a copy of this message
I don't think I made myself clear on the globals. The only situation there would be a problem is if PHP were built threaded and libxml2 were not (which as of 2.5.8 it is built threaded by default). When running threaded, each thread has its own global state, so when modified at request startup/shutdown the global is only changed for that thread, rather than being set at the module startup/shutdown which would set the default values used to initialize the global states of the threads. Rob Wez Furlong wrote:
Sounds like a nasty situation. I don't think it's possible to sanely restore the handlers at rshutdown in a threaded build without screwing up the other threads that are currently executing. My suggestion is to not restore the handlers for threaded builds, and if there is a library sharing/abuse issue, then treat it as an installation/configuration problem for the person deploying it (eg: don't do that!). There's not much you can do about that without rewriting libxml2 to not use globals for the callbacks. :-/


« previous php.internals (#22505) next »