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 :
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.