2

The title is the question it is.

Legend:

  1. Project A = .Net Core project

  2. Project B = Legacy C++ project

  3. MMF = Persistent Memory-mapped file

Detailed question description:

I currently working on (PROJECT A) which using [DllImport] to import native library which written on C++ to access the MMF.

I have another legacy application (PROJECT B) continuously updating that MMF.


What I want is, if there is some change in specific section of the MMF. We trigger the function in project A.


If you have any clue, please help. Thank you

  • You need to use IPC and synchronisation. Which makes one wonder why you don't use a message passing approach instead of shared memory. What made you choose shared memory? – David Heffernan Sep 17 '19 at 07:06
  • Windows can track changes to files, but it won't notify you of what specific bytes have changed. You could use a combination of notifications (`FIleWatcher` et al) combined with reading the relevant parts of the file, or per David you'll need to actually implement specific mechanisms to signal the change beyond just changing the file. – Jeroen Mostert Sep 17 '19 at 09:49
  • @DavidHeffernan since my legacy application using MMF as storage. And I don't have authorize to change the architecture of it – Kien Alexander Nguyen Sep 18 '19 at 00:11
  • By the time that you've implemented the message passing and synchronisation, you may as well do it all that way – David Heffernan Sep 18 '19 at 07:05

0 Answers0