So, that's what I'm trying to do - pretty self-explanatory actually :
- Initiate X 'simultaneous' processes (each bound to a different php script)
- Be able to say when all of them are finished
I've had a look at various different approaches, and I'm probably going to use exec
and background processes. (Something along these lines).
The thing - which I really can't get my head around - is :
I can't figure out which is the most efficient way to check whether ALL of the processes are finished (being able to keep an eye on the general progress - e.g. X out of Y finished, is also a must).
What is important is time-efficiency, and - obviously - not causing any unnecessary server overload (so, I suppose any 'frozen' while
loop checking for live pid
s, even if at intervals, is out of the question, right?)
ANY suggestions are very much welcome!
P.S.: I've initially set this whole thing up with asynchronous Ajax requests starting from the client-side, but I'm currently considering a migration to a non-javascript fully-server-side environment. The issue with parallel-processing though remains...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…