0

Many years ago ago I created many-threaded code on one-kernel processors. I don't remember if it was Posix' PThreads.

Can someone please clarify what Intel/AMD means when they say "4 cores 4 threads (if HT - or SMT - not activeated)"? I should be allowed to create as many threads as I want on the 4-kernel CPU! Do they mean something different with "4cores 4THREADS"?

Say I CAN create how many threads I desire, is the scheduler smart enough to utilize all available kernels? Is the same true about Windows scheduler?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 2
    In hardware parlance, a "thread" is a physical unit capable of executing code. With hyperthreading enabled, one core has two (hardware) threads. These "threads of execution" (the original meaning) have nothing to do with the OS-level, software concept of threads, which are virtual (which is why you can create as many of them as you like, but no more than the hardware can support will ever be running truly concurrently, with the OS faking the rest by switching between them). And yes, the whole point of a scheduler is to perform the mapping between software threads and hardware threads smartly. – Jeroen Mostert Aug 08 '20 at 15:09
  • Related: [8 logical threads at 4 cores will at a maximum run 4 times faster in parallel?](https://stackoverflow.com/q/10403201) – Peter Cordes Aug 08 '20 at 16:10
  • thx alot Jeroen, very helpful! – nero_pelleman Aug 08 '20 at 18:20

0 Answers0