Re: [PHP4BETA] sapi_xxx_module()

From: Date: Sat, 28 Aug 1999 11:39:13 +0000
Subject: Re: [PHP4BETA] sapi_xxx_module()
References: 1 2 3  Groups: php.version4 
Request: Send a blank email to php-version4+get-3801@lists.php.net to get a copy of this message
At 10:44 28/08/99 , Sascha Schumann wrote:
    I need something which is called way before per module inits.
    If there is any other way, just tell me. It would be
    especially useful, if the shutdown function would be actually
    called at shutdown time.
Did you guys think this whole business through? I'm afraid we're hitting a completely non-portable barrier here, and the way I see it, we're better off offering less functionality than offering a non portable infrastructure. Let me explain. A shared memory pool in a multiprocess environment is almost completely useless. It's useless since you would want to use it for shared resources, but since you don't control these resources, you can't do anything with this shared pool. The most you'd be able to share through this pool is zval's or the likes, and I doubt it's worth messing with shared memory for those. In both multiprocess and multithreaded environments, you would have to protect any shared resources (ones you managed to actually use through shared memory) from being accessed from more than one thread/process at the same time. The way PHP 4.0 is designed, or rather, the way the thread-safe version of PHP 4.0 was designed, was to emulate a multiprocess environment within a multithreaded environment. That is, each thread has its own persistent resources, that are managed independently from other threads. This makes development of plugin modules identical under a multiprocess and a multithreaded environment, as long as you follow some simple rules. Any multiprocess plugin module can be converted to a thread safe module (provided the underlying 3rd party library is thread safe, of course). From the experience we've gained in PHP 3.0, and the experience and implementations of others (e.g., ODBC under Windows NT), if you want to have resource pools, you should be using IPC and an established protocol between the client (PHP) and the server. If you write a separate process with which PHP speaks, that handles poolable resources - things would work best. Stig once started writing such a thing. I don't know where it stands today, but perhaps its time to revitalize it. Either way, I think we should think this through very carefully before going on. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#3801) next »