Right, I apologize too, never had to work with php multi-threading and
looking at it existing framework wrappings don't look this good at first
glance as it's only meant either for compiled code or command line exec, for
C-like expected behaviour. Some Frameworks such as Copix provide script
interpreted upper classes that seem to be limited in terms of sharing
variables and consequently session data. There remains the ability to
compile php and load it into server's memory although this might not be the
most common handy way of php-ing. Please note there are always workarounds,
that most of existing technologies may do what the other does and that Java
being a restrictive language doesn't make it, imho, the most "elegant
coding" programming language.

On Sat, Mar 21, 2009 at 6:50 PM, Jonathan Mast
<jhmast.develo...@gmail.com>wrote:

> OK, so what would it look like? Show me a comparable snippet of PHP code.


Not sure my experience in php multithreading is worth a code snippet but, if
interested, you might like have a look at :
- http://php.net/pcntl_fork
- http://pear.php.net/package/PHP_Fork



> How does one enable this feature if its off by default?  Why is it off by
> default? I guessing it opens up security issues and/or has side effects.
> Not
> conducive to enterprise-level computing, imho.


PCNTL functions are native and seem as reliable as the system is for
prodiving parallel processing features, please note java Threads can't
either be compared to System Processes, one of the reason why java 1.5
provided you with some ThreadPoolExecutor services + others, whereas PCNTL
allows you to access system level calls i.e. it won't do any good under
windows as it's simply not built for parallel processing.

What is PEAR? Is that like the standard JavaSE library? The last time I was
> on php.net it seemed to be something that must be downloaded separately
> from
> the php server.


PEAR is an open-source framework and distribution system for reusable PHP
components. Aside php distribs, you're right.



> >relies on OS abilities.
> Does this mean my PHP code would have to tailored to Windows, MacOSX, or
> Linux? Please clarify.


You're right again it mean it's tailored to the Server OS, as said above you
can't expect parallel processing to be running properly on a
non-unix/linux/bsd/... environment. I doubt anyhow one may would go blindly
changing his/her app's OS as a "it's meant to work" even though it's
supposedly meant to.

Reply via email to