1
$\begingroup$

I understand that a process may have multiple threads, and that a processor may have multiple cores to run processes in parallel.

But I can't understand how a core may allow multiple threads, what does it change from a core with one thread support?

$\endgroup$
3
$\begingroup$

See Wikipedia on Computer Multitasking and Time-sharing, which have an explanation of how operating systems allow this. Basically, they switch between multiple threads.

Read also about hardware multithreading. This allows a single core to execute multiple threads concurrently, without switching between them.

$\endgroup$
  • $\begingroup$ Thanks! After your answer I search in books for more information aiming to hardware multithreading and I understood $\endgroup$ – Emirg Apr 24 '16 at 4:20
0
$\begingroup$

Any core "can" work on a multitude of processes or threads - you can have multithreading on single core machines (or more threads than cores in general).

The expensive part with threads is context switching - saving and restoring the set of (nowadays rather large) registers when switching to a different thread. If a core is advertised as "supporting two threads" (in opposite to "n threads"), one might guess it has either capabilities for hardware threading, but, more likely, ist just has an extra register bank.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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