I have two big programs (more than 5000 lines in C++)and I wanna to couple them together.
in fact each program needs the the other program result to start next iteration. as an idea I want the first program reads the initial input file and this file is removed by the first program and new results are written on the new file for the second program.the second program dose the same process, reading, deleting and writing a new file and this new file is needed to start the first program.
now the problem: each program after each iteration must be wait to get new data from the other program (in a shared folder), because how I can do that ?
Search for "Mutex" in the docu of your operating system and programming environment. I think boost.org has a fairly portable mutex and locking library as well..
This might be stupid, but is there a good reason for keeping 2 programs, instead of merging the code in one program, than calling the needed function of each program sequencially from the same place? This way you could even exchnange function results in memory instead of using files that must be saved, loader, and parsed