[fpc-pascal] Optimal number of threads for SMP

Marco van de Voort marcov at stack.nl
Thu Sep 18 19:48:31 CEST 2014

In our previous episode, Bernd said:
> If the CPU has hyper threading then these should show up as individual
> cores (CPUs). They call a "core" with 2 processors on it a "core" but
> each of these "cores" is actually two complete processors (cores in
> the conventional meaning of the word) that just share some common
> circuitry to speed up some things (and slow down other things).
> If you have 2 hyper cores then your operating system should actually
> report 4 CPUs (cores) because that is what it actually is if you
> remove all the intel marketing terminology, no need to double any
> numbers. If it reports 4 CPUs then you have exactly 4 CPUs.

Hyperthreading doubles the execution stream logic, so that one core can
take two incoming streams of instructions. The idea is that when one thread
stalls, or executes unoptimal code, the other thread can run, increasing
utilization. But that is more something like 10%, not doubling it.

Since the rest of the core (the execution units) can't actually handle
processing two streams at full speed.

You are probably confused with AMD's module system, which does duplicate
cores, and only shares some logic (like AVX)

More information about the fpc-pascal mailing list