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, 2018 in Programmer Questions by Billbo911 (1,050 points)
edited Jan 14, 2018 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, 2018 by JeVois (36,680 points)