I was curious about the difference between these two. I found a Reddit post about this, and I thought I’d summarize it here so that the content is replicated to lemmy.
Please be aware, this is not from a perspective of a computer scientist. I am very interested in computer science, but have a lot of knowledge gaps.
The premise of the question: Both of these seem to be methods of running two or more tasks / sub-tasks without necessarily using multiple cores. The concepts geeked similar to me, but I will explain the difference below.
How does the OS scheduler’s multi tasking works (besides multi-threading)?
Basically, when the operating system is running two or more tasks, it may be running more tasks than cores available. To deal with this, it switches between these tasks very quickly - so fast it seems they’re running concurrently.
Hyper threading
A hyper threaded CPU looks a bit different. To the user, it is interfaced almost like an extra core. Think about a multi core CPU. Every core is almost its own CPU. With hyper threading, some of those components are replicated, but not enough to make an extra core. (remember, CPU has many components, such as ALU, floating point units, load/store units, branch units, etc) However, the CPU arranges tasks in a way where two tasks can be using different parts of the CPU, hence can run concurrently on the same core. It is not super often that this happens, which is why a separate core is faster than hyper threading. But we are able to speed up tasks with concurrency faster than switching between them. This can be enhanced by the operating system scheduler scheduling tasks in an order making it likely to run concurrently on a hyper threaded CPU, in other words, scheduling tasks that will likely use different parts of the CPU and not conflict.
I hope this is a good summary, and I hope computer scientists can correct me if I’m wrong.