Forum Moderators: mack

Message Too Old, No Replies

How the Same Server Script Handles Two User Requests at the Same Time?

         

webgaya

11:33 am on Aug 1, 2007 (gmt 0)

10+ Year Member



I have an idea about this. But if anyone can give a clear
explanation, it would be really helpful.

Say there is a PHP script resides on a PHP enable server
which takes two numbers from a user (via a web form) and
display the sum of them.

It takes number one to the variable $no_one and number
two to the variable $no_two and result is passed to the
variable $sum.

When two users pass inputs to this script at the same time
from two different locations, how does the script handle it?

Are two instances of the script created and instance of
each variable created for each request?

phranque

6:50 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



typically the server would spawn an independent process for each request.
each process runs its own copy of the script and there is no shared memory.
as each request is satisfied the subprocess dies and hopefully releases all its resources.