Questions tagged [ipc]

IPC stands for Inter-process Communication and represents a set of methods for exchanging data and messages between threads and processes.

In computing, Inter-process communication (IPC) is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for:

  • message passing
  • synchronization
  • shared memory, and
  • remote procedure calls (RPC).

The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated.

There are several reasons for providing an environment that allows process cooperation:

  • Information sharing
  • Speedup
  • Modularity
  • Convenience
  • Privilege separation

IPC may also be referred to as inter-thread communication and inter-application communication.

The combination of IPC with the address space concept is the foundation for address space independence/isolation.

4538 questions
208
votes
5 answers

On localhost, how do I pick a free port number?

I'm trying to play with inter-process communication and since I could not figure out how to use named pipes under Windows I thought I'll use network sockets. Everything happens locally. The server is able to launch slaves in a separate process and…
Anton L.
  • 2,397
  • 2
  • 17
  • 8
164
votes
12 answers

IPC performance: Named Pipe vs Socket

Everyone seems to say named pipes are faster than sockets IPC. How much faster are they? I would prefer to use sockets because they can do two-way communication and are very flexible but will choose speed over flexibility if it is by considerable…
user19745
  • 3,499
  • 8
  • 25
  • 21
155
votes
4 answers

Example of Named Pipes

How do I write a simple--bare minimum needed for it to work--test application that illustrates how to use IPC/Named Pipes? For example, how would one write a console application where Program 1 says "Hello World" to Program 2 and Program 2 receives…
Jordan Trainor
  • 2,410
  • 5
  • 21
  • 23
150
votes
2 answers

Signal handling with multiple threads in Linux

In Linux, what happens when a program (that possibly has multiple threads) receives a signal, like SIGTERM or SIGHUP? Which thread intercepts the signal? Can multiple threads get the same signal? Is there a special thread dedicated entirely to…
user500944
141
votes
8 answers

Combining node.js and Python

Node.js is a perfect match for our web project, but there are few computational tasks for which we would prefer Python. We also already have a Python code for them. We are highly concerned about speed, what is the most elegant way how to call a…
Cartesius00
  • 23,584
  • 43
  • 124
  • 195
122
votes
8 answers

Interprocess communication in Python

What is a good way to communicate between two separate Python runtimes? Things tried: reading/writing on named pipes e.g. os.mkfifo (feels hacky) dbus services (worked on desktop, but too heavyweight for headless) sockets (seems too low-level;…
wim
  • 338,267
  • 99
  • 616
  • 750
121
votes
2 answers

wait process until all subprocess finish?

I have a main process which creates two or more sub processes, I want main process to wait until all sub processes finish their operations and exits? # main_script.py p1 = subprocess.Popen(['python script1.py']) p2 = subprocess.Popen(['python…
Nikhil Rupanawar
  • 4,061
  • 10
  • 35
  • 51
107
votes
10 answers

fastest (low latency) method for Inter Process Communication between Java and C/C++

I have a Java app, connecting through TCP socket to a "server" developed in C/C++. both app & server are running on the same machine, a Solaris box (but we're considering migrating to Linux eventually). type of data exchanged is simple messages…
Bastien
  • 1,537
  • 2
  • 10
  • 19
100
votes
4 answers

System V IPC vs POSIX IPC

What are the differences between System V IPC and POSIX IPC ? Why do we have two standards ? How to decide which IPC functions to use ?
Meghasyam
  • 1,021
  • 2
  • 9
  • 7
90
votes
9 answers

What is the simplest method of inter-process communication between 2 C# processes?

I want to create a communication between a parent and a child process, both written in C#. It should be asynchronous, event-driven. I don't want to run a thread in every process to handle the very rare communication. What is the best solution for…
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
89
votes
6 answers

Which Linux IPC technique to use?

We are still in the design-phase of our project but we are thinking of having three separate processes on an embedded Linux kernel. One of the processes with be a communications module which handles all communications to and from the device…
RishiD
  • 2,098
  • 2
  • 26
  • 24
88
votes
1 answer

How do Unix Domain Sockets differentiate between multiple clients?

TCP has the tuple pairs (IP Addr/port/type) to tell one client from another. UDP passes the client IP and port. How does the unix domain keep track of different clients? In other words the server creates a socket bound to some path say…
Translucent Pain
  • 1,441
  • 2
  • 14
  • 18
87
votes
8 answers

What is the best choice for .NET inter-process communication?

Should I use Named Pipes, or .NET Remoting to communicate with a running process on my machine?
mrbradleyt
  • 2,312
  • 7
  • 33
  • 38
81
votes
4 answers

Comparing Unix/Linux IPC

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 perform?
user27424
  • 1,371
  • 2
  • 12
  • 12
81
votes
7 answers

How to have 2 JVMs talk to one another

I have the following situation: I have 2 JVM processes (really 2 java processes running separately, not 2 threads) running on a local machine. Let's call them ProcessA an ProcessB. I want them to communicate (exchange data) with one another (e.g.…
tnk_peka
  • 1,525
  • 2
  • 15
  • 25
1
2 3
99 100