快速进程间(跨线程)通信IPC大型多CPU系统线程、进程、快速、通信

2023-09-11 05:51:16 作者:冷

什么是进程间通信速度最快的便携式双向沟通机制,其中从一个应用程序线程需要在同一台计算机上的其他应用程序通信,多线程,以及通信线程可以在不同的物理CPU)。

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.

不过,共享互斥是非常昂贵的(也有一些人​​太有限),当线程在不同的物理CPU运行同步。

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

推荐答案

如果你要使用C ++,提升了便携pretty的低水平IPC库。它可以让你同步和进程之间共享内存。

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/库/ 1_42_0 / DOC / HTML / interprocess.html