Does PHP support multi-thread ?

Does PHP support multi-thread ?

am 18.04.2010 15:17:08 von fikm

------=_NextPart_4BCB0654_08B51F00_1F5AA78C
Content-Type: text/plain;
charset="ISO-8859-1"
Content-Transfer-Encoding: base64

SGVsbG8sIGV2ZXJ5b25lLCBwbGVhc2UgYW5zd2VyIG1lLiBUaGFuayB5b3Uu DQogRG9lcyBQ
SFAgc3VwcG9ydCBtdWx0aS10aHJlYWQgPw==

------=_NextPart_4BCB0654_08B51F00_1F5AA78C--

Re: Does PHP support multi-thread ?

am 18.04.2010 15:36:37 von Angus Mann

Oh No !

Not again !

Pleeeeease !!

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"
To: "php-general"
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: Does PHP support multi-thread ?

am 18.04.2010 16:39:14 von 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" 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: Does PHP support multi-thread ?

am 18.04.2010 17:08:26 von 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" 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: Does PHP support multi-thread ?

am 18.04.2010 20:37:53 von ahlin.hans

2010/4/18 Angus Mann :
> Oh No !
>
> Not again !
>
> Pleeeeease !!
>
> 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"
> To: "php-general"
> 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

Re: Does PHP support multi-thread ?

am 19.04.2010 12:53:34 von Richard Quadling

On 18 April 2010 14:17, ttplayer 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 =3D new COM("WScript.Shell");
$oExec =3D $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=3D17214

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.


--=20
-----
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=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling

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