Can the same DLL data be shared by 2 different processes?

后端 未结 5 1565
无人及你
无人及你 2020-12-10 08:12

I have two different C# applications that are running at the same time.

I would like both of them to be able to access the same \"instance\" of a DLL (also in C#).

5条回答
  •  执念已碎
    2020-12-10 08:36

    The process space will be different so, for example, global variables in the DLL will be specific to each separate process. It is possible that the code in memory will be shared (Windows typically uses reference counting to make that part more efficient).

    If you are wanting to share information that is accessed in the DLL between the two processes, then it seems likely that it will be necessary to use some kind of IPC (interprocess communication) mechanism such as sockets, shared memory, pipes, etc.

提交回复
热议问题