On 23/09/2015 22:16, j adams wrote:
Not my intention to be combative, but what abouthttp://php.net/pcntl_fork ? I've used that before in a robust distributed application that runs without any intervention for months. It's my understanding that PHP is thread safe, but not itself multithreaded. I believe there are some extensions which aren't thread safe. Also correct me if I'm wrong but Apache 2 should be run in it's prefork mode when using PHP.
Process forking is very different from multi-threading. Your original question was whether a central object store could cause problems, but as I understand it a forked process shares no memory with its parent, so that's not a problem.
The internal thread safety mode ("ZTS") does indeed have to duplicate the object store for each thread, though. The general idea (in Zend Engine 2 / PHP 5, at least) being that a structure is passed around via TSRM* macros and ultimately used by the EG macro in place of a true global: http://lxr.php.net/xref/PHP_5_6/Zend/zend_globals_macros.h#45
All of this is something of an aside from what you really wanted to know, though. :)
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php