Which inter-process communications technique is best?

  • Thread starter Thread starter Paul Baker
  • Start date Start date
P

Paul Baker

Hello All,

This is my first post so apologies if this is the wrong newsgroup.

I'm designing software for a platform that will sit on a CAN bus. There
will be three separate programs running on the platform, A, B and C.
Program A will handle the CAN communications. It will pass messages
received from the CAN network to programs B and C and transmit their
messages out on the CAN network.

What is the best (fastest) method for transferring messages between the CAN
communications process and the other two processes?

Currently I'm leaning towards named pipes but would like to pass the CAN
messages as structures and not simply as "streams" of data.

Got any suggestions?

Thanks

Paul
 
Hi Paul!
I'm designing software for a platform that will sit on a CAN bus. There
will be three separate programs running on the platform, A, B and C.
Program A will handle the CAN communications. It will pass messages
received from the CAN network to programs B and C and transmit their
messages out on the CAN network.

What is the best (fastest) method for transferring messages between the CAN
communications process and the other two processes?

I would suggest to use OPC...
It is a standard-interface (other apps also can connect to your
device)... you can simply use a OPC_Toolkit (for example
http://www.softing.com/en/communications/products/opc/tools/cplusplus.htm)

Currently I'm leaning towards named pipes but would like to pass the CAN
messages as structures and not simply as "streams" of data.

If you want a really fast solution you should either cinsidering of
writing a device-driver (which can be connected from different apps) or
you can use memory-mapped-files...

In general you can take a look at:
http://msdn.microsoft.com/library/en-us/ipc/base/interprocess_communications.asp


But as I said: I would use OPC. It is really fast (erarly-bound COM is
fast (IMHO)) and it is a standard interface which can be used by others.

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Paul said:
What is the best (fastest) method for transferring messages between the CAN
communications process and the other two processes?

I don't know CAN, but the fastest IPC is shared memory (memory mapped
files). It's just as fast to read/write data in shared memory as it is
in normal memory allocated with malloc or new. Nothing else can even
come close to that speed (sockets, pipes, COM, etc., are much slower).
This is, of course, when both processes reside on the same computer.

Tom
 
Paul Baker said:
Currently I'm leaning towards named pipes but would like to pass the CAN
messages as structures and not simply as "streams" of data.

Got any suggestions?

As Jochen and Tamas have pointed out there are faster ways to go. But pipes
have a few appealing characteristics

1) they are easy to implement and use with file semantics
2) they are easily securable
3) they are easily impersonable
4) they can be message rather than stream oriented

And if you move the pipe server, you merely change the name of the pipe to
use in the client.

<rant>
As for COM, I hate it for no better reason than that it exists largely for
the benefit of VB "developers". <gd&r> Plain vanilla RPC seems to me to be
far more attractive.
</rant>

Regards,
Will
 
Chaps,
Many thanks for the useful advice you've given me. I've got more choices
than I expected.

Jochen,
I'll try to cross-post in future! By the way I think we'll be using the
Softing FG-100 CAN to Ethernet gateway device.

Thanks

Paul
 
Back
Top