0

Does hyper threading change the binary code sequence of a compiled program?

If we had a compiled binary code of say: 10100011100011100101010010011111100011111110010111 If hyper threading were enabled, what would a thread represent? Would it be just some section of this binary code? How does the operating system allocate time intervals for these threads?

For parallelism: Would the compiled binary code be any different? How the cores handle this binary sequence? Just execute some section of the code in different cores? How does the operating system allocate parallel task? Is there any specific structure?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

1

Most programs are compiled to be run by a particular operating system, on any member of a broad family of processors (e.g., on Windows, for the x86-64 family). Within a given CPU family, there may be CPUs with different numbers of cores, and there may be cores with or without hyperthreading.

None of that changes the binary code. The same program typically will run on any member of the CPU family, without any changes.

The operating system in which the program runs may or may not be differently configured for different members of the processor family.


Sometimes, a program can be compiled to exploit the features of a specific CPU, but programs compiled in that way are unsuitable for distribution to different sites and/or PCs.


If we had a compiled binary code of say: 101000111000... If hyper threading were enabled, what would a thread represent? Would it be just some section of this binary code?

That's an unanswerable question. You can learn more about what "binary code" means by reading an introductory book on computer architecture. E.g., https://www.amazon.com/Elements-Computing-Systems-Building-Principles/dp/0262640686/

Solomon Slow
  • 25,130
  • 5
  • 37
  • 57