Comparisons
Two things routinely conflated, put side by side. Neither column is the winner — what decides is the workload and the machine.
Hardware thread vs OS thread
A hardware thread is an execution context on a core — a set of registers and a slot in the front end. An OS thread is a schedulable software entity. The OS multiplexes many of the latter onto few of the former, which is why thread counts in your program and in your CPU spec mean different things.
Zero switching cost — the state is already resident
Fixed and small; shares execution resources with its siblings
Reasoning about SMT gains and execution resource contention
Unlimited in number, and independently schedulable
Context switches cost registers, cache and TLB state
Reasoning about scheduling, blocking and concurrency design
| Dimension | Hardware thread | OS thread |
|---|---|---|
| Created by | The CPU designer | Your program |
| Count | Fixed by the hardware | Thousands, if you like |
| Switch cost | None — both are resident | Real, and worse if caches go cold |