Hi guys
I was wondering, what actually the reason is that PHP itself does not support
multi-threading?
I guess this would be realizable, or not? If not, why?
Maybe this is a stupid question, but still somehow interesting. Realization in
a way as Java does (or just something in that way) would act
Johannes Reichardt hat am 30. Oktober 2012
um 16:37 geschrieben:
> > In times of testability and several design patters, the use of static calls
> > is
> > really outdated.
> > I understand that you can read and write the invocations of the methods much
> > faster, but you should think more to t
"Florian Müller" hat am 31. Oktober 2012 um 07:58
geschrieben:
> Hi guys
> I was wondering, what actually the reason is that PHP itself does not support
> multi-threading?
> I guess this would be realizable, or not? If not, why?
> Maybe this is a stupid question, but still somehow interesting. Rea
Hello Florian,
Usually you want to run a PHP script in two different environments:
1. inside a webserver
2. in a command line interface
For a web application, the application server does the work for you.
It is the server job to have a thread pool and balance it correctly.
So you don't need threa
Yes Marco has right.
But more than that, OOP is mainly designed to run in a single threaded
environment and it is not the best idea to be used for concurrent
programming because you will need synchronization everywhere and this slows
down the code, but also ask for a lot of other troubles.
I thin
I actually tought about just the same structures as Java uses(something in this
way:
Thread t = new Thread(new Runnable() {public void run() {...blabla
}}
I thought this would actually be a good benefit if PHP supported this. It's
just as we sometimes use PHP for doing some big Ser
Ovidiu Farauanu hat am 31. Oktober 2012 um 09:59
geschrieben:
> Hello Florian,
>
> Usually you want to run a PHP script in two different environments:
> 1. inside a webserver
> 2. in a command line interface
>
> For a web application, the application server does the work for you.
> It is the ser
Ovidiu Farauanu hat am 31. Oktober 2012 um 09:59
geschrieben:
> Yes Marco has right.
>
> But more than that, OOP is mainly designed to run in a single threaded
. I don't put a comment on that.
> environment and it is not the best idea to be used for concurrent
> programming because you wil
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
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 freshly-for
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 sen
On Wed, Oct 31, 2012 at 6:46 AM, 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 sa
>
>
> 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
On Tue, Oct 30, 2012 at 7:33 AM, ma...@behnke.biz wrote:
>
> In times of testability and several design patters, the use of static
> calls is
> really outdated.
> I understand that you can read and write the invocations of the methods
> much
> faster, but you should think more to the future on th
On 10/31/12 1:58 AM, Florian Müller wrote:
Hi guys
I was wondering, what actually the reason is that PHP itself does not support
multi-threading?
I guess this would be realizable, or not? If not, why?
Maybe this is a stupid question, but still somehow interesting. Realization in
a way as Java d
On Wed, Oct 31, 2012 at 11:37 AM, Florian Müller
wrote:
> I actually tought about just the same structures as Java uses(something in
> this way:
> Thread t = new Thread(new Runnable() {public void run() {
> ...blabla }}
> I thought this would actually be a good benefit if PHP suppor
On Wed, Oct 31, 2012 at 9:27 AM, Alex Nikitin 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 typical
>
Consider the following code:
';
}
}
bob::factory();
$var = 'bob';
$var::factory();
?>
When I run this, "In Factory!" is displayed twice, as I would expect.
So by all accounts, there's nothing wrong with the code. However, when
I run that file through ZendCodeAnalyzer, I get the followin
Am 31.10.12 18:13, schrieb Adam Richardson:
> On Tue, Oct 30, 2012 at 7:33 AM, ma...@behnke.biz wrote:
>
>> In times of testability and several design patters, the use of static
>> calls is
>> really outdated.
>> I understand that you can read and write the invocations of the methods
>> much
>> fa
Am 31.10.12 18:13, schrieb Adam Richardson:
> While OOP is one way to approach programming, it's not the only way. Even
> Rasmus has said he leans procedurally:
> http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html
Found another interesting discussion on that topic:
http://
> It's just as we sometimes use PHP for doing some big Server works (e.g.
> database copying or something) and
> it would be nice to controll by yourself which Thread (or process) does which
> part of the job.
>
I don't suppose that the client is sitting there waiting for a reply
until the brows
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
data
On Wed, Oct 31, 2012 at 4:46 PM, Marco Behnke wrote:
>
> 1. If you have code using static methods and members and use phpunit for
> testing it, you have to either make sure, that everything is properly
> resetted after use OR have to run phpunit in a mode where every test is run
> in a single php
On Wed, Oct 31, 2012 at 3:42 PM, Christoph Boget
wrote:
> Consider the following code:
>
> class bob
> {
> static function factory()
> {
> echo 'In factory!';
> }
> }
>
> bob::factory();
> $var = 'bob';
> $var::factory();
> ?>
>
> When I run this, "In Factory!" is displayed twice,
24 matches
Mail list logo