I
I
Ilya Korol2019-04-05 22:41:15
linux
Ilya Korol, 2019-04-05 22:41:15

How to implement data exchange between Python 3.5+ processes?

So there is a Python process that creates N child processes using multiprocessing.Process .
It is necessary to implement N-1 data exchange between all threads (from the master to each of the children, but each of the children does not have access to any other child).
Implementation with strings and databases is discouraged.
Preferably with Python examples on using libraries.
The Python version is 3.4+.
The solution should work on Linux Ubuntu, preferably on Windiws 10.
Thanks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2019-04-05
@welcome32

Queues, pipelines and shared memory. This is detailed in the documentation .

R
Roman Kitaev, 2019-04-05
@deliro

With 3.5 ProcessPoolExecutor and async/await will work just fine. You don't even have to spawn processes manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question