weixin_33744141 2013-11-13 06:10 采纳率: 0%
浏览 34

在php中对AJAX调用进行线程化

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.

  • 写回答

3条回答 默认 最新

  • 叼花硬汉 2013-11-13 06:13
    关注

    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

    评论

报告相同问题?