Hi!

1) any hints or clues from people familiar with the Zend subsystems -
such as memory management, and the various stacks, to provide hints as
to how to set them up "correctly"

Zend Engine keeps all state (including memory manager state, etc.) separate in each thread, which means once you've created a new thread it has to run initializations for the data structures. It should happen automatically when you build the engine in threaded mode (--enable-maintainer-zts). You can not share any data between the engine threads - unless you communicate it through some channel external to the engine - and even in this case you should use a copy, never the original pointer. This also means you can not use PHP functions, classes, etc. from one thread in another one. I'm not sure what you tried to do in your code, so hard to say what exactly went wrong there. Another caveat: while Zend Engine makes a lot of effort to keep the state localized and thus be thread-safe, not all libraries PHP is using do so, so running multithreaded PHP with these libraries may cause various trouble.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to