Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Do all instances of python run on the same thread?

I’m aware of the discussions around threading, multithreading, and multiprocessing in python, but my question is whether all instances of python that are called run in parallel?
I’m not suggesting using a single python script to spawn many threads, but literally starting the same script a few times in different terminals. Will they be in true parallel?
Just citing that this might be the same question with the answer, but my knowledge isn’t sufficient to be sure.
Or is the python interpreter locked so all processes no matter how they’re started still need to use the same interpreter to operate?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Maybe, but it doesn’t really have anything to do with Python itself.

Depending on your system and your hardware, the different processes may run in parallel, but it depends. Take for example a single core machine with no threading (rare these days, but very possible): because it can only possibly run one process at a time, then there’s no possible way it could run parallel. If you have an operating system and a shell that’s smart, then it might run them in parallel, but there’s nothing that says it must.

If I had to guess, I’d say you can safely your (remotely modern) machine does run the processes at the same time. However, if you’re running it on some kind of embedded system this might not be the case.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading