BIt of a long shot here, but I am wondering if there is a way to execute multiple scripts or functions simultaneously...

I am aware that PHP basically reads and executes code from top to bottom, but I could really do with something that would execute x number of functions/code all at once (x <10).

Basically, I have code that goes out to remote servers x times, and if there is no response after 10 seconds gracefully dies. The thing is, when x=10, the code is waiting 100 seconds if all remote servers do not respond. If there was a way I code execute all the [same] code at once, the maximum wait period would be an acceptable 10 seconds.

Anyone have a solution???

    I am using that to set the time limit to 10 seconds for each time the function is called (x times)
    the whole script is set to no time limit, since I need each function call to execute fully (even if fully==die gradefully)
    What I want is for x function calls to execute simulatenously, so the overall script execution time will only be 10 seconds, not X*10 seconds.

    I don't think there is a way in php, but I was just asking (maybe there is another way)

      Write a Reply...