How to share information synchronously between 2 MT4 instances via File? - page 2

 

I wouldn't use "FILE_SHARE_READ|FILE_SHARE_WRITE".

I would suggest the following procedure:

  1. The writer appends its content at the end of the 'common' file.
  2. The reader reads the whole content and deletes (or empties - which ever is faster) this file.
  3. If either one can't access (blocked be the other) the file it falls into a small sleep loop until the file is free again.

This keeps the file small and the reader know all the time what I read is new to me which saves itself an additional admin.-work what is new what not.

May be the writer adds the write time in case of a crash or weekend or ...