What are all the disadvantages of using files as a means of communication between two processes?

I have outdated code that I need to improve for performance reasons. My application consists of two executable files that must exchange certain information. In legacy code, one exe is written to a file (the file name is passed as an exe argument), and the second executable file first checks to see if such a file exists; if there are no checks again, and when he finds it, he continues to read the contents of the file. In this way, information is transferred between two executable files. A way to structure the code, the second executable file is successfully executed on the first attempt.

Now I need to clear this code and wonder what are the disadvantages of using files as a means of communication, and not for interactions between processes such as pipe. Is opening and reading a file more expensive than pipes? Are there any other disadvantages? And how important, in your opinion, is a decrease in productivity.

Inherited code runs in both windows and linux.

+5
source share
2 answers

Some problems with using files for IPC:

  • What happens when process (1) writes a file, when process (2) finds it? You need to have special logic to handle this case.

  • , (1) , (2) ? (1) - , , , .

  • , IPC.

, - , . , .. , , .

, , , , IPC- .

-, , , IPC, , .. , .

+3

, , , . , . .

IPC, -, .

+1

All Articles