Anyway, the problem in PHP is one of implementation. The reason it has problems is because dl loads/unloads for every request, rather than loading and leave loaded like all other languages.
I fixed a similar issue recently in the interbase module. I ended up NULLing the dlopen() handle in the module struct, which prevents the Zend engine from unloading it.
As a result, the library is never closed, and pointers to its functions/variables remain valid throughout the lifetime of the main process. However, because of the way the engine works, all the exported zif_* functions are unregistered, and consequently are not available to requests that do not dl() the module.
Couldn't this scheme be extended to something that fixes the current issues with dl(), instead of deprecating it ? By not closing the library, all resource destructors and module globals remain present, so (persistent) resources and objects can be cleaned up. The exported functions will not be available to all subsequent requests.
All that remains is the multi-threading issue, which is currently taken care of by the '#if !ZTS' enclosings ...
-- Ard
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php