Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Multithreading [RSS Feed]

#1 Dec. 8, 2005 00:45:54

Bart d.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Dear PHP creators,I was wondering. (And I'm probably the 1000th person asking this.) Withall the multiple-core processors and servers popping up lately, arethere any future (or current) plans for multithreading in PHP?It's not unlikely to have a PHP script that, for example, needs to sendan email, do some database transactions and perhaps communnicate with aweb service simultaneously. In such situations where the script needs towait for multiple external actions it could really improve performance.I know there are other ways to do it. (It's possible to do"multithreading" with sockets.) Still I think it would be cool if therewould be native support. As a fanatic PHP programmer it has always beensomething that I envy about in other languages.Bart

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

Offline

#2 Dec. 8, 2005 00:49:42

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Bart de Boer wrote:Dear PHP creators,I was wondering. (And I'm probably the 1000th person asking this.) Withall the multiple-core processors and servers popping up lately, arethere any future (or current) plans for multithreading in PHP?It's not unlikely to have a PHP script that, for example, needs to sendan email, do some database transactions and perhaps communnicate with aweb service simultaneously. In such situations where the script needs towait for multiple external actions it could really improve performance.I know there are other ways to do it. (It's possible to do"multithreading" with sockets.) Still I think it would be cool if therewould be native support. As a fanatic PHP programmer it has always beensomething that I envy about in other languages.There are no plans for this. Asynchronous mechanisms are generally amuch more efficient way to do this stuff.-Rasmus

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

Offline

#3 Dec. 8, 2005 00:55:25

Ilia A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


You don't need threads, you can use fork() for that. On *nix systems it
is very fast, nearly as fast as threads and much safer to boot. And you
can already do forking in PHP via PCNTL extension's pcntl_fork() function.

Ilia

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

Offline

#4 Dec. 8, 2005 01:32:35

Bart d.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Rasmus Lerdorf wrote:Bart de Boer wrote:Are there any future (or current) plans for multithreading in PHP?There are no plans for this. Asynchronous mechanisms are generally amuch more efficient way to do this stuff.-RasmusWith asynchronous I'm asuming you mean mechanisms where you call otherscripts (web services) from within the main script? Besides the extraoverhead, scripts and code, I guess this is a good alternative.The thing is. I'm currently working on a project that I'm forced to dowith *cough* M$ C# *cough*. I hate everything about it except for thethreading. Which is... not so bad. :) With just a teeny bit of extracode I'm able to call some functions or methods in seporate threads andwait untill they're done.Just think it would be nice... :)

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

Offline

#5 Dec. 8, 2005 01:33:06

Bart d.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Ilia Alshanetsky wrote:You don't need threads, you can use fork() for that. On *nix systems it
is very fast, nearly as fast as threads and much safer to boot. And you
can already do forking in PHP via PCNTL extension's pcntl_fork() function.

IliaThat sounds sufficient enough. Although I guess this only works on *nixsystems? Platform independence is one of the main reasons I prefer PHPover other languages.--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#6 Dec. 8, 2005 02:25:35

Wez F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Try proc_open().

--Wez.

On 12/7/05, Bart de Boer <> wrote:
> Ilia Alshanetsky wrote:
> > You don't need threads, you can use fork() for that. On *nix systems it
> > is very fast, nearly as fast as threads and much safer to boot. And you
> > can already do forking in PHP via PCNTL extension's pcntl_fork() function.
> >
> > Ilia
>
> That sounds sufficient enough. Although I guess this only works on *nix
> systems? Platform independence is one of the main reasons I prefer PHP
> over other languages.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>

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

Offline

#7 Dec. 8, 2005 02:35:57

Joseph C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


php should defenatly in the future support multi-threading especially if
they want to prove you can do desktop apps with php and not just web apps ;)

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021

Offline

#8 Dec. 8, 2005 02:42:49

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Joseph Crawford wrote:php should defenatly in the future support multi-threading especially if
they want to prove you can do desktop apps with php and not just web apps ;)Which is not something we have ever stated to be a goal.

-Rasmus

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

Offline

#9 Dec. 8, 2005 02:49:37

Ilia A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Bart de Boer wrote:
> Ilia Alshanetsky wrote:
>
>> You don't need threads, you can use fork() for that. On *nix systems it
>> is very fast, nearly as fast as threads and much safer to boot. And you
>> can already do forking in PHP via PCNTL extension's pcntl_fork()
>> function.
>>
>> Ilia
>
>
> That sounds sufficient enough. Although I guess this only works on *nix
> systems? Platform independence is one of the main reasons I prefer PHP
> over other languages.

fork() works on windows as well, but on Win32 forking is MUCH slower
then threads.

Ilia

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

Offline

#10 Dec. 8, 2005 03:09:32

Andrei Z.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Multithreading


Exactly. Something based on libevent would be nice.

-Andrei


On Dec 7, 2005, at 4:49 PM, Rasmus Lerdorf wrote:There are no plans for this. Asynchronous mechanisms are generallya much more efficient way to do this stuff.-Rasmus--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Multithreading [RSS Feed]

Board footer

Moderator control

Enjoy the 22nd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support