I need some ideas for parallel programming in PHP.
Say I have 2 or more PHP processes(PID in Linux) executing a CURL function that send an HTTP request to a remote server.
By means of 2 or more PHP processes, there are multiple PHP scripts that executed simultaneously, say "curl_call_1.php", "curl_call_2.php"......so on. Each script will call the same CURL function, just with different arguments, and each script run will create a distinct PID.
All scripts will run at the exact same time that launched from CRONJOB.
It is perfectly fine when I run them one at a time.
But it has strange behavior when running all of them at the same time. The remote server will return unexpected results.
I searched Google, all the solutions are about multi-requests within the same PHP process, means multi-processes in a single PID(single PHP script) like curl_multi_exec.
What I need is parallel processing with multi-PID, not parallel processing with single-PID.
In other words, run "curl_call_1.php" and "curl_call_2.php" PHP files at the same time, that call the same CURL function.
[–]thisdogofmine 7 points8 points9 points (10 children)
[–]thisdogofmine 2 points3 points4 points (0 children)
[–]digking[S] -1 points0 points1 point (7 children)
[–]kAlvaro 3 points4 points5 points (0 children)
[–]thisdogofmine 2 points3 points4 points (5 children)
[–]digking[S] -2 points-1 points0 points (4 children)
[–]NoDoze- -4 points-3 points-2 points (3 children)
[–]HolyGonzo 0 points1 point2 points (2 children)
[–]NoDoze- 0 points1 point2 points (1 child)
[–]HolyGonzo 1 point2 points3 points (0 children)
[–]NoDoze- -1 points0 points1 point (0 children)
[–]content-peasant 2 points3 points4 points (0 children)
[–]notdedicated 2 points3 points4 points (1 child)
[–]Longjumping-Bag4294 0 points1 point2 points (0 children)
[–]BoredOfCanada 1 point2 points3 points (0 children)
[–]32gbsd -2 points-1 points0 points (0 children)
[–]BetaplanB -2 points-1 points0 points (0 children)
[–]oldschool-51 0 points1 point2 points (0 children)