Communication and synchronization between Windows applications
Posted on 2005-03-03
Using Visual C++, I need to have different applications read (and write to) the same text file at same time. The text file contains lines of phone number. Each record should be used only once by appilcations. For example, when one application reads in 5 records, the next application would continue reading from the 6th and so on. So there is an index variable which saves current position and to be accessed by all applications.
The question is what is the machanism for Windows to achieve this? what are the Win APIs for it.
Also as multiple applications are reading the file simuteniously, what are Win API (or any thing) to be used to avoid racing problem. ( this could happen while one app reads in a record, but before increase record index to point to next record, the second app reads the same record)
Please notice that this is not multi threads issue. Its multi app(tasking) comm and synch issue.
Thank you for you help!