Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Python multi-threading

0 votes
I am looking for examples of how to set up a multi-threaded Module in Python.

I would like to process the same image by two completely separate processes.

There is a good tutorial for C++11, but nothing I could find for Python.
asked Jan 13 in Programmer Questions by Billbo911 (520 points)
edited Jan 14 by Billbo911

1 Answer

0 votes

Good question! My initial guess was to just use the python module “threading” but further reading seems to imply that this will not allow you to truly parallelize over multiple cores because of limitations of the python global interpreter lock. So it seems that threads are a no go in python generally, if your goal is concurrent execution of several algorithms. Process-level parallelism looks like an option then, with resources here for example:


The “multiprocessing” module, in particular, is included in python 3. We have not tested this ln jevois yet, will try asap. I see no reason why jevois-daemon would have issues with a fork() approach but we never know.

answered Jan 15 by JeVois (20,780 points)