python multiprocessing

dieter dieter at handshake.de
Mon Oct 9 03:08:23 EDT 2017


Xristos Xristoou <saxri89 at gmail.com> writes:

> I have three functions in the python that each one puts an image (image path) as input and makes a simple image processing and creates a new image (image path) as output.

In order to make effective use of multiprocessing, you need to split
your complete task into (mostly) independent subtasks and let them be processed
by subprocesses. For this to be effective, the subtasks must need
significant processing. If dependencies remain, the processes must
communicate which makes things more complicated and less efficient.

I agree with Stefan Ram: if you have essentially a single image
which gets processed in order by different alorithms, then you
have a sequential process which can not profit from multiprocessing.

However, if you have a set of input images, then you can process
each image in a separate process -- and potentially gain significantly
in speed.




More information about the Python-list mailing list