logoalt Hacker News

ls65536 • today at 12:32 PM • 0 replies • view on HN

A thread blocked on IO gets taken off the CPU by the operating system though, so it isn't "running" as a thread on the CPU, and it isn't using up any resources in this context that might be contending with another SMT thread (other than maybe things like leftover TLB entries or cache lines that become much more likely to just get evicted soon anyway).

In some sense you can think of SMT as a lower-level resource sharing capability (of execution units and various buffers and such) inside the CPU core, which is somewhat analogous to how the operating system shares the higher-level logical CPU by timeslicing access to it across different runnable threads. The latter capability also layers on top of the former, which makes for some interesting performance implications from an operating system scheduler's point of view, but they're still different things.