Comparing Unix/Linux IPC

前端 未结 4 1136
情书的邮戳
情书的邮戳 2020-11-28 00:33

Lots of IPCs are offered by Unix/Linux: pipes, sockets, shared memory, dbus, message-queues...

What are the most suitable applications for each, and how do they perf

4条回答
  •  感动是毒
    2020-11-28 01:14

    Here is a webpage with a simple benchmark: https://sites.google.com/site/rikkus/sysv-ipc-vs-unix-pipes-vs-unix-sockets

    As far as I can tell, each has their advantages:

    • Pipe I/O is the fastest but needs a parent/child relationship to work.
    • Sysv IPC has a defined message boundary and can connect disparate processes locally.
    • UNIX sockets can connect disparate processes locally and has higher bandwidth but no inherent message boundaries.
    • TCP/IP sockets can connect any processes, even over the network but has higher overhead and no inherent message boundaries.

提交回复
热议问题