How to count results in all parallel processes?

  Kiến thức lập trình

Only the main idea, with request for help.

file index.php
it use exec(some_script.php with params)
to start a “parallel” process of counting and saving data to DB.

some_script.php can success or not save the data. the result is logged.

Problem is: how to get the number of successes and fails results in index.php.

Due to the code I could not use &$output of exec to share result. =(

What type of storage not blocking an not rewriting data by different processes?

Not session
Not cookies
Not static values

Files to store result of each process? – sounds not good.
Database? – sounds too heavy.