I would like to share data between a program A written in C++ pr C and another program B written in Java. The two program can be located in different networks. How can I do this? The simplest idea is to use a shared file where one program writes and the other program reads. The problem is how to manage the read/write conflicts. For example if the program A is writing the file how can I assure that the program B does not read the file? Is there a better way than a shared file?