sharing memory between two applications

61,157

Solution 1

You can use Memory Mapped Files.

Here is an article describing how to use them.

Solution 2

You can use Named Pipes.

A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication. The use of instances enables multiple pipe clients to use the same named pipe simultaneously.

Any process can access named pipes, subject to security checks, making named pipes an easy form of communication between related or unrelated processes.

Solution 3

Use a Windows File Mapping Object which allows you to share memory between processes.

Share:
61,157
uniquepito
Author by

uniquepito

Updated on March 13, 2020

Comments

  • uniquepito
    uniquepito about 4 years

    I have two different windows applications (two different people writing the code). One is Written in C++ and another one is in C#. I need some way how to share data in RAM between them. One must writes data and another one just reads the written data. What should I use to make it most effective and fast? Thanks.

  • FindOut_Quran
    FindOut_Quran about 8 years
    They are limited to logical address space. (Max of 2GB in my case, although my RAM is 16GB)
  • Martin Kersten
    Martin Kersten over 7 years
    This is not an issue since you can map multiple files.
  • Broots Waymb
    Broots Waymb about 5 years
    Just FYI, page at the 2nd link is missing/disabled.