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.

Hardware threadOpen lesson →
Strengths

Zero switching cost — the state is already resident

Costs

Fixed and small; shares execution resources with its siblings

Use when

Reasoning about SMT gains and execution resource contention

Strengths

Unlimited in number, and independently schedulable

Costs

Context switches cost registers, cache and TLB state

Use when

Reasoning about scheduling, blocking and concurrency design

DimensionHardware threadOS thread
Created byThe CPU designerYour program
CountFixed by the hardwareThousands, if you like
Switch costNone — both are residentReal, and worse if caches go cold