The way cores, processes, and threads work exactly?

Posted by unknownthreat on Stack Overflow See other posts from Stack Overflow or by unknownthreat
Published on 2010-06-07T03:31:49Z Indexed on 2010/06/07 3:42 UTC
Read the original article Hit count: 191

I need a bit of an advice for understanding how this whole procedure work exactly. If I am incorrect in any part described below, please correct me.

In a single core CPU, it runs each process in the OS, jumping around from one process to another to utilize the best of itself. A process can also have many threads, in which the CPU core runs through these threads when it is running on the respective process.

Now, on a multiple core CPU,

  • Do the cores run in every process together, or can the cores run separately in different processes at one particular point of time? For instance, you have program A running two threads, can a duo core CPU run both threads of this program? I think the answer should be yes if we are using something like OpenMP. But while the cores are running in this OpenMP-embedded process, can one of the core simply switch to other process?

  • For programs that are created for single core, when running at 100%, why the CPU utilization of each core are distributed? (ex. A duo core CPU of 80% and 20%. The utilization percentage of all cores always add up to 100% for this case.) Do the cores try help each other run each thread of each process in some ways?

Frankly, I'm not sure how this works exactly. Any advice is appreciated.

© Stack Overflow or respective owner

Related posts about multithreading

Related posts about architecture