I was learning about multi-processing and multi-threading.
From what I understand, threads run on the same core, so I was wondering if I create multiple processes insid
I'm not a pyhton expert but I expect this is like in other languages, because it's an OS feature in general.
A process is executed by the OS and owns one thread which will be executed. This is in general your programm. You can start more threads inside your process to do some heavy calculations or whatever you have to do. But they belong to the process.
One or more threads are owned by a process and execution will be distributed across all cores.
When you create a given number of threads these threads should in general be distributed across all your cores. They're not limited to the core who's executing the phyton interpreter. Even when you create a subprocess from your phyton code the process can and should run on other cores.
You can read more about the gernal concept here: Preemptive multitasking
There're some libraries in different languages who abstract a thread to something often called a Task or something else. For these special cases it's possible that they're just running inside the thread they were created in. For example. In the DotNet world there's a Thread and a Task. Often people are misusing the term thread when they're talking about a Task, which in general runns inside the thread it was created.