Linux IPC选择?
发布时间:2020-05-23 10:40:09 所属栏目:Linux 来源:互联网
导读:我有两个进程A和B.A和B有时需要进行通信(双向)以传递信号,消息等. 我已经做了一些关于IPC在 Linux中可用的基础研究,如信号量,消息队列,dbus等. 现在我在决定使用哪一个时感到困惑,谁能告诉我哪个IPC更适合我的应用? 提前致谢 编辑:阐述应用程序. (这是一个
|
我有两个进程A和B.A和B有时需要进行通信(双向)以传递信号,消息等.
提前致谢 编辑:阐述应用程序. (这是一个嵌入式应用程序) 解决方法IPC技术的选择取决于您尝试实施的应用.以下是对性能的良好比较:IPC name Latency Throughput Description
-----------------------------------------------------------------------------------------
Signal Low n/a Can be used only for notification,traditionally-
to push process to change its state
Socket Moderate Moderate Only one mechanism which works for remote nodes,not very fast but universal
D-Bus High High A high-level protocol that increases latency and
reduces throughput compared to when using base
sockets,gains in increased ease of use
Shared n/a High Data saved in-between process runs(due to swapping
memory access time) can have non-constant access latency
Mapped files n/a High Data can be saved in-between device boots
Message Low Moderate Data saved in-between process runs. The message
queue size is limited but there is less overhead
to handle messages
这是一个更好的比较 Comparing Unix/Linux IPC (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
