Author Topic: Hyperthreading - Revisited  (Read 30 times)

AW

  • Member
  • *****
  • Posts: 1486
  • Let's Make ASM Great Again!
Hyperthreading - Revisited
« on: Today at 12:51:21 AM »
This is a follow up of this message where I mentioned that the detection method I was using failed with AMD Ryzen processors and that I would try another approach.

This new approach is API based so it should work for both Intel and AMD because the OS will handle the nitty-gritty details on our behalf.

The results do not explicitly mention Hyperthreading because this is an Intel specific term and there are other possibilities. However, when Logical processors is more than Processor Cores you may in general consider the reason is Hyperthreading.

Code: [Select]
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Vendor: GenuineIntel
Family: 6
Number of NUMA nodes: 1
Number of Physical Processor Packages: 1
Number of Processor Cores: 6
Number of Logical Processors: 12

daydreamer

  • Member
  • ****
  • Posts: 533
  • reach for the stars
Re: Hyperthreading - Revisited
« Reply #1 on: Today at 01:48:04 AM »
When hyperthreading was new,I read advice to turn off hypertreading for best performance,it would be nice to make a test for this,to test if its true or false or in some code its true and some it is false
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

AW

  • Member
  • *****
  • Posts: 1486
  • Let's Make ASM Great Again!
Re: Hyperthreading - Revisited
« Reply #2 on: Today at 03:04:36 AM »
When hyperthreading was new,I read advice to turn off hypertreading for best performance,it would be nice to make a test for this,to test if its true or false or in some code its true and some it is false
I believe most games and applications scale well with a thread pool up to the number of logical cores. Personally, I have doubts that switching off hyperthreading will improve, but some people may know a lot more than I do about this.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5764
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Hyperthreading - Revisited
« Reply #3 on: Today at 03:43:32 AM »
From memory it used to be a limitation at an operating system level where if you had a multi-threading processor back then the OS could not properly use the capacity. With QE I use a similar approach to Jose's output taken directly from the operating system as its easy enough to handle and reliable.

Funny enough I am writing some CPUID code at the moment, mainly so it can find the instruction set family that can be used with each processor so you can dial in code to a processor version without it crashing on older hardware. It handles up to AVX ok but I have to decipher Intel's current manual for AVX2.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: