one-to-many IPC

妖精的绣舞 提交于 2019-12-06 09:29:08

问题


I'm looking for an ipc mechanism which would allow high throughput of data updates from one process to many (thousands).

The 'server' process would be responsible for updating a data structure at a high frequency. Upon update, I'd like to notify the 'client' processes of the update, and allow those processes to read the new data.

Under a Linux or FreeBSD environment, what would be a good way to go about this?


回答1:


I would recommend using ZeroMQ. It's a fast, lightweight, cross-platform, cross-language messaging system that already does all you're asking for. It's easy to use, and very robust. It can operate in many, many modes, one of which is one to many messaging (this is called broadcast in CS-speak).




回答2:


While not clear on your setup limitations or requirements (all processes in the same machine?), it looks that the most versatile solution would be to use MPI which is platform-independent and distributed. In particular, it provides broadcasting functionality.

The downside is that you would have to model your design a bit after the MPI API.



来源:https://stackoverflow.com/questions/9982046/one-to-many-ipc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!