Skip to content

Simultaneous multithreading

Category: Parallelism · Status: stub

One line: One physical core presenting two or more logical cores to the operating system, sharing its execution resources between them.

Also called: SMT, Hyper-Threading.

In each language

Go runtime.NumCPU counts logical CPUs
Python os.cpu_count returns logical CPUs
C# Environment.ProcessorCount counts logical processors, capped by CPU affinity and CPU limits
JavaScript navigator.hardwareConcurrency counts logical processors
The operating system sched_setaffinity(2) pins a thread to chosen logical CPUs

Where to read more