0
$\begingroup$

If a dual core processor have 4 threads, then what will happen if i run an application which uses more than 4 threads?

And just to make sure i'm understanding what are threads in a cpu, when an application uses more than one "task" on its main process a single core will switch back and forth between the threads to give the illusion that it is running them in parallel, is that right?

$\endgroup$
1
  • $\begingroup$ Processors/cores have power consumption more prominently than threads. They may support more than one thread, a fixed number more often than not. There may be operations from different threads in progress at the same time, grain&level of parallelism differing, marketing terms as well. $\endgroup$
    – greybeard
    May 1, 2021 at 6:35

1 Answer 1

1
$\begingroup$

If there are $2$ cores and $4$ threads, two threads will be assigned to each core. Similarly, if there are $6$ threads, three threads will be assigned to each core. For example, suppose $6$ threads are $T_1,T_2,T_3,T_4,T_5,T_6$. Then, say $T_1,T_2,T_3$ are assigned to core $1$ and $T_4,T_5,T_6$ are assigned to core $2$.

As you are saying, $T_1,T_2,T_3$ will switch back and forth on core $1$ to give an illusion of parallel. However, note that $T_1$ and $T_4$ are indeed running in parallel on different cores.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.