4

What would be the fastest portable bi-directional communication mechanism for inter-process communication where threads from one application need to communicate to multiple threads in another application on the same computer, and the communicating threads can be on different physical CPUs).

I assume that it would involve a shared memory and a circular buffer and shared synchronization mechanisms.

But shared mutexes are very expensive (and there are limited number of them too) to synchronize when threads are running on different physical CPUs.

IPC
  • 159
  • 5
  • What exactly are you hoping to communicate between these processes and threads? – SamB Apr 21 '10 at 23:14
  • Another problem that I see that can affect the performance: Once the message is delivered dispatcher will have to make a context switch to deliver a message. Large number of RPC messages will have a huge effect on performance. And it does not look like adding a communication facility directly between threads in not scalable (in the worse case one thread can deliver messages to multiple remote threads). – IPC Apr 23 '10 at 06:07
  • I'm trying to deliver large number of relatively small variable length RPC messages. – IPC Apr 23 '10 at 06:09

2 Answers2

1

You probably want to start by looking at the existing libraries such as MPI and OpenMP. They tend to be tuned fairly well.

If you're willing to entertain more cutting-edge approaches, then you can try what Barrelfish is doing, see http://www.barrelfish.org/barrelfish_sosp09.pdf .

redtuna
  • 4,586
  • 21
  • 35
1

If you are going to use C++, boost has a portable pretty low level IPC library. It allows you to synchronize and share memory between processes.

http://www.boost.org/doc/libs/1_42_0/doc/html/interprocess.html

Laserallan
  • 11,072
  • 10
  • 46
  • 67