What is the best IPC method for interacting inside a machine in Win32?

I need to implement an interprocess communication system for processes (in machines) in Win32 using native C ++ (.NET is not applicable). For more detailed information, I consider a message routing system between processes using binary formatted messages. Sending / receiving messages should be asynchronous.

TCP socket can be one of the selected. But I just want to know if there might be a better choice for high performance. (I can ignore security issues.)

I do not request detailed code, but only your ideas.

+4
source share
3 answers

If you have time to save money, and if you like risk and experimentation, you can use the undocumented Windows feature: Call local procedures . It was forever, and it is probably the fastest because it is the basis for everyone else.

+4
source

You can also watch named pipes: http://msdn.microsoft.com/en-us/library/aa365590%28v=vs.85%29.aspx . I also know MemoryMappedFiles for IPC: http://msdn.microsoft.com/en-us/library/ms810613.aspx , but I personally have never tried. I used both NamedPipes and Socket on the same IPC strategy for one computer, but I frankly changed the measured performance difference between the two approaches, or at least I didn’t notice such a big difference to say “avoid this ...” or "prefer this other ...". Perhaps, starting with a technology in which you are more confident, you will get a good working result and more free time;)

+3
source

I am a fan of memory mapped files. Wrap with read / write locks for access restrictions.

+2
source

Source: https://habr.com/ru/post/1346520/


All Articles