For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > August 2005 > PHP concurrent script execution









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP concurrent script execution
jw7u

2005-08-26, 3:55 am

I'm experiencing some very weird behavior. I have a simple script that
inserts a row into the DB, then sleeps for 30 seconds. If I try to run
the script concurrently by opening 2 browser windows, the 2nd instance
will not run until the 1st instance of the script has finished
executing (30 seconds). This is NOT what I expected.

However, if I run the script from IE, then again concurrently from
Mozilla, everything is fine! Or, if I run the script from computer A,
then load it from computer B, it runs concurrently just fine! It's
only when I'm loading the script on twice on 1 computer, using the same
internet browser, that it does not run concurrently. Does anyone have
any ideas??

Thanks in advance.

Jan

2005-08-26, 3:55 am

It seems that you're using a Session, right?
For more informations take a look at
http://de2.php.net/manual/en/functi...write-close.php

-
Jan

Wayne

2005-08-26, 9:55 pm

On 26 Aug 2005 00:08:35 -0700, "jw7u" <PokerEdge@gmail.com> wrote:

>I'm experiencing some very weird behavior. I have a simple script that
>inserts a row into the DB, then sleeps for 30 seconds.


I shouldn't ask but: Why do you have a webpage sleep for 30 seconds?

>If I try to run
>the script concurrently by opening 2 browser windows, the 2nd instance
>will not run until the 1st instance of the script has finished
>executing (30 seconds). This is NOT what I expected.


It could be that your browser is the hold up, not the server. While
your script is sleeping for the 30 seconds it still has an HTTP
connection open and the browser is still waiting for a response. It's
entirely possible (even likely) that the browser will not issue
another request for the same resource until the first request
completes.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com