Re: [PHP] Re: Multithreading for OOP PHP

2012-11-03 Thread Joe Watkins
On 31/10/2012 13:46, Alex Nikitin wrote: Hey guys (and/or gals), I have heard this question entirely too many times, I think at some point Rasmus just stopped responding to it. The real reason that PHP is not threaded has nothing to do with PHP internal or extension thread safety, the reason is

Re: [PHP] Re: Multithreading for OOP PHP

2012-11-03 Thread Alex Nikitin
Threading doesn't increase complexity? Spoken truly like somebody who has not had to actually write, test and debug proper, high performance threaded code. Please tell me how threading doesn't increase complexity of any data structure? I may agree if you talk about php running in cli, but then the

Re: [PHP] Re: Multithreading for OOP PHP

2012-11-03 Thread Dotan Cohen
As far as php side goes, it's a problem of design of the apps. Just because people decided to go through hoops to use the threaded model doesn't mean that it is any faster than writing to the same thing in event driven model, event driven way is sometimes much faster than threads. I'm on

[PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alessandro Pellizzari
Il Wed, 31 Oct 2012 11:57:11 +0100, ma...@behnke.biz ha scritto: But it if PHP would be threadsafe, you would be able to run the Apache in a much faster and less memory using way. There once was a configure option in PHP to compile it threadsafe, but they dropped it for a reason. Because PHP

[PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alessandro Pellizzari
Il Wed, 31 Oct 2012 11:50:00 +0100, ma...@behnke.biz ha scritto: The drawback of forking is the memory overhead. With every fork you take the same amount of memory which is not the case if you could use real threads. No, it is not. Forking in Linux uses COW (copy-on-write), so a

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
Hey guys (and/or gals), I have heard this question entirely too many times, I think at some point Rasmus just stopped responding to it. The real reason that PHP is not threaded has nothing to do with PHP internal or extension thread safety, the reason is more to the extent that it doesn't make

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Tommy Pham
On Wed, Oct 31, 2012 at 6:46 AM, Alex Nikitin niks...@gmail.com wrote: Hey guys (and/or gals), I have heard this question entirely too many times, I think at some point Rasmus just stopped responding to it. The real reason that PHP is not threaded has nothing to do with PHP internal or

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
That's all understood but there are times when that one request from the visitor requires many sub-requests like connection to DB and making SOAP calls. I would say it's more than just there are times, that's how a typical script lives, it imports libraries, queries the database, and talks

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Tommy Pham
On Wed, Oct 31, 2012 at 9:27 AM, Alex Nikitin niks...@gmail.com wrote: That's all understood but there are times when that one request from the visitor requires many sub-requests like connection to DB and making SOAP calls. I would say it's more than just there are times, that's how a

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
You do all that in the context of a single PHP instance and linear code, calling curl_multi handles its own threading, you just get back results, you dont have to store it anywhere outside PHP memory space, and you can configure timeouts and all that stuff, or you can regulate it yourself. The