I hope you don't mind if I ask a question or two. It's allways good for me when someone asks questions concerning how I want to carry out something. Besides, this helps me excercise my thinking cap. So, don't take what I say (type) here as the gospel:-|!
Anyways, when you say "Multithreads", are you actually talking about the process itself doing more than one thing at a time? Or just simply pulling information from multiple sources, however it does it? It seems to me like the users browser would need to establish multiple simultaneous socket connections to download all that information concurrently. Would there be that much of a performance hit if these tasks are carried out serially?
Besides, I don't know if PHP truly supports multi-threading like Java or C. Perhaps someone would be so kind as to enlighten me.
However, I'm guessing that if you are using multiple servers, you could have one script fire up multiple processes on different servers and collect the information, store it in a user cache for instance to be updated at a particular interval, or when the users wants the info re-cached. Then the process doesn't need to run everytime the user wants the info. However, if PHP doesn't provide or support multithreading, then wouldn't one still have to wait for the completion of each remotely fired script?
Here's an idea. Have one script fire off multiple scripts that may be residing on other servers without waiting for them to finish or return data. Those scripts could be cron jobs on other server perhaps that would output the data to a database. The original script, after sleeping for a specified amount of time could then go back and collect the retrieved information and present it to the user and/or cache it for later (and faster) retrieval.
Anyways, perhaps it would be cool if there was something like clone() or fork() to work with.
Anybody have anything to say about this, please feel free to respond, I am all ears on this one.
Hope this helps at least a little,
Later on,
Terrence