0

I'm thinking to use MemoryMappedFile to share memory between multiple processes.
While one process is reading and writing (and something more), I don't want another process to access the memory.

If it is possible, how could I implement it?

Nigiri
  • 3,469
  • 6
  • 29
  • 52

1 Answers1

0

It is a common practice to use synchronization objects like Mutex or Semaphore when dealing with inteprocess synchronization. Named mutex could be shared between processes and give what you want, especially if you have managed and unmanaged code runnning on separate processes.

But be aware that mutex that was created by process with more elevated rights will not be accesible for processes with less rights. Such thing could happen when you create mutex on windows service with some kind of admin rights and then will try to access mutex from IIS web application which was launched as Network Service.

Alexander Manekovskiy
  • 3,185
  • 1
  • 25
  • 34