Process communication

I am looking for some data to help me decide which one will be better / faster for communication between two independent processes in Linux:

  • TCP
  • Named Pipes

What's worse: system overhead for pipes or tcp overhead?


Updated exact requirements:

  • only local IPC required
  • basically there will be many short messages
  • no cross platform needed, only Linux
+3
source share
8 answers

. , TCP/IP . , / .

, , TCP/IP.

+4

, ( ). , TCP?

, , , .

+3

. , . , (, 2 , ... , ). . , .

Edit , . (, ). "" "" 100 . 10 000 . , , , . , , - :

  • TCP/IP: .067 ms
  • /: .042 ms
  • /: .033 ms
  • : .011 ms
+3

TCP , , , . .

+2

, :

TCP:

(1) - 3- , () .

(2) - IP ( ..), TCP ( , , ..), , , (, ).

- TCP , (.. ) - (: ), (: , ).

: - , - , named/domain pipes, , , .

+2

, , IPC ( ) Linux - . ( , ).

- , , , , .

, , , , Windows, / .

+2

unix - goog. tcp, , . , , - , .

+1

I think the pipes will be a little easier, but I just guess.

But since the pipes are local, much less complex code is probably involved.

Other people can tell you to try and measure both to find out. It is hard to make a mistake with this answer, but you may not want to invest time. This would leave you hoping that my guess is correct;)

0
source

Source: https://habr.com/ru/post/1727765/


All Articles