hello.php
is my file responding to AJAX call through javascripts by users.
now if e.g two users, username A and B send their GET request to hello.php at same time. In hello.php i made code to sleep for 5 min if user is A but will generate instant response if user is B. Now will the response generated by hello.php will be recieved by B or both A&B?
Or in short Can PHP thread a function itself if it is called by two users at a same time like explained above.
Each request will be handled independently.
What response will be sent to user is depended only on the code you made in Hello.php
You dont need to worry about time of requests done. Apache handles that for us
Response of user A will be sent to user A only and same for user B and every other user.
I will like to hear more on this from others who have different opinion
User information should be included in the AJAX call through javascript, then whether the call is from A or B should be judged in hello.php. In hello.php code you can decide whether to sleep or not.
I agree with Bhavik Shah as the requests are handled independently only.
This is web and its made only for the purpose to have multiple access at a time and to handle each request according to particular user you need not to include any user information in the calls.
Its totally independent.