views:

112

answers:

4

Hello everyone,

I have several process in my system that need to communicate with each other.

Some of the processes need to pass chunks of data 60 times per second continuously, and some are very sporadic.

Most of the processes are in C#, one is C++.

All running on the same windows 7 machine.

Right now each process has it's own different comm implentation (pipes, events and sockets). I'm looking to unify into one communication layer.

  • How would you implement this?
  • Maybe some kind of broadcast with the intended receiver as header?
  • What method of process communication would you choose?

Thanks,

SW

+1  A: 

I'm using a WCF service to communicate between .Net processes and .Net and Java processes. I found WCF a very easy way to achieve this purpose.

jpsstavares
Seems very interesting, two questions: 1. can it handle passing data at 60hz, 2. Will it play nice with C++ ?
Shachar Weis
I don't realy know about either question. The implementation for the communication between two .Net processes can use pipes to communicate so I think it can handle thar rate. For the communication between .Net and Java I'm using TCP/IP so I don't know if it works fine at that rate.About the second question, I think you won't have problems if you have a nice WebService library. I'm sending objects between .Net and Java and they are (de)serialize into/from XML with no problems. But I haven't tried with C++.
jpsstavares
+1  A: 

Take a look at MSMQ. It's socket-based and quite fast. This article describes how to use it from C++: http://msdn.microsoft.com/en-us/library/ms811055.aspx.

You also didn't mention whether your communication is synchronous or asynchronous (does the writer have to wait for a response from the reader?). Do you have multiple writers and readers? Is it a constant 60Hz or does it come in bunches with breathing room where readers can catch up to writers?

A database table can also be used as a queue, and has the advantage of persisting the messages if the system crashes. A low-overhead embedded engine like Sqlite is well-suited for this.

ebpower
+1  A: 

I would suggest using ICE, which supports remote objects and message passing. It will have no problem meeting your rates and bandwidth needs. It's also cross platform and supports languages other then just C# or C++, giving you more languages choices for other components.

Joe
A: 

Note that messaging middleware solutions (like WCF and ICE) are powerful engines giving you features like reliable message delivery, control over message ordering, distributed (multi-machine) capability etc.

They are also relatively complex and may involve a degree of 'framework' learning.

If your application currently works reliably today, it might be an idea to introduce whatever messaging solution you select for your next new functionality initially and prove it there first. You could then retrofit to your existing processes (if...) and when necessary.

Mick