By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,691 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

PHP Threading

P: n/a
Has anyone got any information or links for some tutorials on threading with
PHP?
I was looking at running a socket listener, and launch off new threads, and
co-ordinate as requests come in.

Cheers,
Graham

May 21 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Graham Weldon wrote:
Has anyone got any information or links for some tutorials on threading
with PHP?
I was looking at running a socket listener, and launch off new threads,
and co-ordinate as requests come in.

Cheers,
Graham
Graham,

The PHP cli doesn't support multithreading. You can get multiple
threads if you're running as an Apache or IIS extension and the
webserver is running multiple threads, but that's all.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 21 '07 #2

P: n/a
On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Graham Weldon wrote:
Has anyone got any information or links for some tutorials on threading
with PHP?
I was looking at running a socket listener, and launch off new threads,
and co-ordinate as requests come in.
Cheers,
Graham

Graham,

The PHP cli doesn't support multithreading. You can get multiple
threads if you're running as an Apache or IIS extension and the
webserver is running multiple threads, but that's all.
That's not completely true. You can the Process Control Functions
(http://www.php.net/manual/en/ref.pcntl.php). However, they're only
avaible on Unix like systems.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

May 21 '07 #3

P: n/a
Benjamin wrote:
On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Graham Weldon wrote:
Has anyone got any information or links for some tutorials on
threading with PHP?
I was looking at running a socket listener, and launch off new
threads, and co-ordinate as requests come in.

The PHP cli doesn't support multithreading. You can get multiple
threads if you're running as an Apache or IIS extension and the
webserver is running multiple threads, but that's all.

That's not completely true. You can the Process Control Functions
(http://www.php.net/manual/en/ref.pcntl.php). However, they're only
avaible on Unix like systems.
That's process forking, which isn't quite the same as multi-threading.
However it can be extremely useful depending on your requirements.

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
May 21 '07 #4

P: n/a
Benjamin wrote:
On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Graham Weldon wrote:
>>Has anyone got any information or links for some tutorials on threading
with PHP?
I was looking at running a socket listener, and launch off new threads,
and co-ordinate as requests come in.
Cheers,
Graham
Graham,

The PHP cli doesn't support multithreading. You can get multiple
threads if you're running as an Apache or IIS extension and the
webserver is running multiple threads, but that's all.
That's not completely true. You can the Process Control Functions
(http://www.php.net/manual/en/ref.pcntl.php). However, they're only
avaible on Unix like systems.
Yes, but those are for multiple processes, not threads. PHP doesn't
support multi-threading.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 21 '07 #5

P: n/a
On Mon, 21 May 2007 11:46:36 +1000, "Graham Weldon"
<gr****@weldon.ath.cxwrote:
>Has anyone got any information or links for some tutorials on threading with
PHP?
I was looking at running a socket listener, and launch off new threads, and
co-ordinate as requests come in.

Cheers,
Graham

PHP isn't good at all for threading - you'd be better of luanching a
Python, Perl or C app from CGI instead.
Brendan Gillatt
www.brendangillatt.co.uk
GPG: 0x6E265E61
May 21 '07 #6

P: n/a
On May 21, 12:44 pm, Brendan Gillatt
<bren...@brendanREMOVETHISgillatt.co.ukwrote:
On Mon, 21 May 2007 11:46:36 +1000, "Graham Weldon"

<gra...@weldon.ath.cxwrote:
Has anyone got any information or links for some tutorials on threading with
PHP?
I was looking at running a socket listener, and launch off new threads, and
co-ordinate as requests come in.
Cheers,
Graham

PHP isn't good at all for threading - you'd be better of luanching a
Python, Perl or C app from CGI instead.
Or Java
Brendan Gillattwww.brendangillatt.co.uk
GPG: 0x6E265E61

May 22 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.