4

I need to implement inter-process communication system for processes (in machine-wide) in Win32 using native C++ (.NET is not applicable). For more detail, I'm considering message routing system between the processes using binary formatted messages. Message sending/receiving must be asynchronous.

TCP socket could be one of the selection. But, I just want to know if there could be better choice for high performance. (I can ignore security problems.)

I'm not requesting detailed code, but just your insights.

Chris Becke
  • 34,244
  • 12
  • 79
  • 148
Daniel K.
  • 947
  • 3
  • 11
  • 21
  • 1
    Its worth mentioning that the Windows API is a C API. – Chris Becke Apr 04 '11 at 08:03
  • possible duplicate of [any good and simple RPC library for inter-process calls?](http://stackoverflow.com/questions/5398673/any-good-and-simple-rpc-library-for-inter-process-calls) – dalle Apr 04 '11 at 08:05

3 Answers3

4

If you have some time to spare, and if you like risk and experimentation, you can use the undocumented Windows feature: Local Procedure Call. It's been there forever, and it's probably the fastest, because it's the foundation for all others.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
3

You shoul have a look at named pipes too: http://msdn.microsoft.com/en-us/library/aa365590%28v=vs.85%29.aspx. I know of MemoryMappedFiles too for IPC: http://msdn.microsoft.com/en-us/library/ms810613.aspx, but I personally never tryed. I used both NamedPipes and Socket on a single machine IPC strategy, but I frankly nevear measured performance difference between the two approach, or at least I did not notice a so big difference to say "avoid this..." or "prefer this other...". Maybe starting with the technology you are more confident in will give you a good working result, and more free time ;)

Felice Pollano
  • 32,832
  • 9
  • 75
  • 115
2

I'm a fan of memory mapped files. Wrapped with reader/writer locks to provide access restrictions.

Angelom
  • 2,413
  • 1
  • 15
  • 8