I want to implement an algorithm that requires a lot of independent calculations using JavaScript for drawing the results (using Canvas) and PHP to do the calculations on the server. So my idea is to create a PHP script for handling a fracture of those calculations and call it multiple times using AJAX. Each call calculating a portion of the algorithm's current iteration step.
Does this result in multithreading on the server in the way that i.e. I make 100 AJAX calls to the script they will be handled simultaneously on the server as soon as they arrive?
Do you have any ideas how I can synchronize this in JavaScript? I need to make sure each AJAX call finishes before entering the next iteration step. Is there something like a best practice for that?
Thanks a lot!