Re: [PHP] Does PHP support multi-thread ?

2010-04-19 Thread Richard Quadling
On 18 April 2010 14:17, ttplayer f...@qq.com wrote:
 Hello, everyone, please answer me. Thank you.
  Does PHP support multi-thread ?

As you've been informed, PHP doesn't natively support threading.

But, the issue of forking was mentioned. I'm on Windows, and by using
a combination of MS's WinCache (I'm using V1.1.0412.0), with an
environment variable APP_POOL_ID set to something nice and unique
(i.e. not set to one used in IIS), and ...

  $WshShell = new COM(WScript.Shell);
  $oExec = $WshShell-Run($script . $params, 0, false);

you can successfully run a child script (or __FILE__ . ' /child:$Child
' . $params  sort of thing) and use wincache to pass data between the
parent and the children scripts.

This is working really well for me with the minor exception of having
to create the env var up front.

Ideally, I'd like to use the fallback logic of having the child script
use the parent process id as the identifier, but here the issue is is
that the parent script will also use the parent process, so no parent
child comms http://pecl.php.net/bugs/bug.php?id=17214

But, if you use APP_POOL_ID, then you'll be just fine.

Of course, if you are not on windows, then other techniques can be
used to simulate this (pcntl, proc_open() - maybe), but I don't know
enough to recommend one over the other.


-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Does PHP support multi-thread ?

2010-04-18 Thread ttplayer
Hello, everyone, please answer me. Thank you.
 Does PHP support multi-thread ?

Re: [PHP] Does PHP support multi-thread ?

2010-04-18 Thread Angus Mann

Oh No !

Not again !

Please !!

This was the subject of a very long and heated discussion a while ago.
No - it does not support multi threading.


- Original Message - 
From: ttplayer f...@qq.com

To: php-general php-general@lists.php.net
Sent: Sunday, April 18, 2010 11:17 PM
Subject: [PHP] Does PHP support multi-thread ?



Hello, everyone, please answer me. Thank you.
Does PHP support multi-thread ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Does PHP support multi-thread ?

2010-04-18 Thread Phpster
Not all libraries are thread safe, so no. 2 seconds with a google  
search would have given you the same answer.


Bastien

Sent from my iPod

On Apr 18, 2010, at 9:17 AM, ttplayer f...@qq.com wrote:


Hello, everyone, please answer me. Thank you.
Does PHP support multi-thread ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Does PHP support multi-thread ?

2010-04-18 Thread Nathan Rixham
yup, check out forking though for related

Phpster wrote:
 Not all libraries are thread safe, so no. 2 seconds with a google search
 would have given you the same answer.
 
 Bastien
 
 Sent from my iPod
 
 On Apr 18, 2010, at 9:17 AM, ttplayer f...@qq.com wrote:
 
 Hello, everyone, please answer me. Thank you.
 Does PHP support multi-thread ?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Does PHP support multi-thread ?

2010-04-18 Thread Hans Åhlin
2010/4/18 Angus Mann angusm...@pobox.com:
 Oh No !

 Not again !

 Please !!

 This was the subject of a very long and heated discussion a while ago.
 No - it does not support multi threading.


+1


 - Original Message - From: ttplayer f...@qq.com
 To: php-general php-general@lists.php.net
 Sent: Sunday, April 18, 2010 11:17 PM
 Subject: [PHP] Does PHP support multi-thread ?


 Hello, everyone, please answer me. Thank you.
 Does PHP support multi-thread ?

ttplayer: here is the subject if you want to read more [PHP] Will PHP
ever grow up and have threading?. it got 257+ replys ;)


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




**
 Hans Åhlin
   Tel: +46761488019
   http://www.kronan-net.com/
   irc://irc.freenode.net:6667 - TheCoin
**

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php