sharing memory between two applications

此生再无相见时 提交于 2019-11-26 20:56:44

You can use Memory Mapped Files.

Here is an article describing how to use them.

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

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.

I recommend you to redesign it to let it use communication based on messages. It is more robust and much easier to use in .NET with its automatic memory management (when compared to shared memory). Although slower.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!