3

Hyperthreading of a cpu core means the core can be treated as logically two or more logical/virtual cpu cores to run multiple processes.

An operating system also provides concurrency programming, by scheduling and context switch.

Do the two do the same thing, i.e. support concurrency programming?

What are their relations? For example, does OS's concurrency require the cpu core to provide hyperthreading, or vice versa?

Thanks.

Tim
  • 1
  • 141
  • 372
  • 590

1 Answers1

4

Hyper threading requires additional hardware support.

  • In a context switch you have to remove all information from the hardware and load the information for the other process in.

  • In case of HT you have duplicated hardware units which have the information of other process pre-loaded so that the switch is very swift.

So for a core that is hyper threaded, the switching does not require taking the entire process control block of the currently running process out and load with the other one. It just needs switching the hardware units from which the instructions are to be read.


Quoting Wikipedia:

Hyper-threading works by duplicating certain sections of the processor—those that store the architectural state—but not duplicating the main execution resources. This allows a hyper-threading processor to appear as the usual "physical" processor and an extra "logical" processor to the host operating system.

displayName
  • 13,888
  • 8
  • 60
  • 75
  • Thanks. So among the two, one does not require the other to provide concurrent programming? – Tim Oct 17 '15 at 17:43
  • Yes, concurrent programming was available long before hyper threading. All that's needed for concurrent programming is "more than one" core. – displayName Jun 08 '22 at 14:56