To: boftx
Your approach makes a lot of sense. The Master (Main script) should be aware of how many slave scripts are attempting to extract the data. As a second step he should be aware of how many processes have all ready extra the data and how many how not yet, until the next iteration.
I am afraid that by trying to create a such a process is a bit out of my league. Well I was also thinking the alternative approach that you proposed using a Data Base (e.g. MySQL). I think this approach will speed my process a lot for all the scripts.
Another alternative that I am thinking also, is that instead of reading all the data of the file Main script into an array, I could simply use append. This approach will also significantly improve the process speed.
But now I am facing two new challenges.
Is there a way to measure the process time for the main script to read and write the data on the file? I am mainly curious because I want to compare this time with the MySQL process time and decide which path I should follow.
The second and final challenge that I am facing, is there a way to apply flock on INI files? I will be pushing all files to use one INI file with different locations of reading of course but still there might be produced a conflict.
Sorry for the continuous questions and messages I am brainstorming any possible solution. Since that kind of processes I will encounter several times in the future so I am looking for the best possible solution to implement.
In reply to Re^2: Reading and writting data in a text file with several scripts simultaneously time synchronization problem
by thanos1983
in thread Reading and writting data in a text file with several scripts simultaneously time synchronization problem
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |