Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Intel Hyper Threading - on or off?

Featured Replies

  • Commercial Member

No but you may find you only need 3 cores for the sim hence the AM=14=(1,1,1,0) mentioned elsewhere often for 4 core HT=Off. Which could just as well be 7=(0,1,1,1).

Steve Waite: Engineer at codelegend.com

  • Replies 75
  • Views 28.3k
  • Created
  • Last Reply

Top Posters In This Topic

No but you may find you only need 3 cores for the sim hence the AM=14=(1,1,1,0) mentioned elsewhere often for 4 core HT=Off. Which could just as well be 7=(0,1,1,1).

 

Hi steve, sorry if I take advantage of your expertise again, i noticed a strange behavior of my system and i would like to know if it makes sense.

 

In this thread http://forum.avsim.net/topic/465624-the-importance-of-cache-freq-overclock-in-p3d/ i described how increasing frequency of CPU CACHE bring me around 4 FPS increase.

 

The strange thing is that with cache @4.6ghz i was getting blurries - ceteris paribus (nothing else changed). So i tried to remove my affinity mask setting (AM=254) and the blurries were gone + i decreased FFTF from 0,11 to 0,01 so i get rid of some micro stutters and increased FPS more.

 

I would like to know if it is possibile that a different cache frequency may change my cores behavior and so my optimal affinity mask setting?

 

tks

No but you may find you only need 3 cores for the sim hence the AM=14=(1,1,1,0) mentioned elsewhere often for 4 core HT=Off. Which could just as well be 7=(0,1,1,1).

 

Hi Steve - I've always worked on the assumption that you blank off the first core (or two logical processors) because being first in line they would by default be used by for processes outside of FSX / P3D. However you suggest that the actual core being masked off does not matter, is this because Windows automatically assigns new processes to the least used core which would most likely be the one being masked off regardless of it's position?

 

In line with this it would seem logical as far as possible to load up FSX / P3D before any third party applications that work outside of it, to try to avoid the main SIM engine being assigned to a core that has already been given some workload. Or will windows dynamically re-assign processes where possible?

  • Commercial Member

Complicated, but in brief, if we start all our apps with no AM then we can see with Task Manager they are distributed across the LPs (or cores). With HT=Off the next processor is a core, but in an HT=On situation and depending on loads, the next LP may be on the same core, so a new thread may be moved along one more LP to the next physical core.

 

Tips: If we try moving threads around with Set Affinity after the sim starts we can't guarantee the same effect as if we start the app with the AM set. If we start the sim from another app, then the sim will start with the affinity of the starting app, unless measures are taken to process the affinity of the sim by the starting app.

Steve Waite: Engineer at codelegend.com

5950x3d 5.4-5.7 GHz - Asus ROG 870 Crosshair Apex - GSkill Neo 2x 24 Gb 6000 mhz / cas 26 -  MSI RTX 5090 Gaming Trio OC - 1x SSD M2 6000 2TB - 1x SSD M2 2800/1800 1Tb -  Corsair 5400  case - Corsair 360 liquid cooling set  - 3x 75’ TCL tv.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 

FOV : 200 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

  • Commercial Member

Seems to be typical of what can be found anywhere and adds nothing to what's been said. Except that P3D does not add an AM depending on CPU, and also core zero is the same performance as any other core.

 

...I've not tried a dual core. If it sets AM=14 on a dual core with HT enabled, that would be handy. Pretty straightforward to run up P3D without a JOBSCHEDULER section in the cfg, and check out its affinity using Task Manager and see it in action.

Steve Waite: Engineer at codelegend.com

LM put in a bunch of code since version 2.3 so you don't need to play with affinity masks anymore.

 

Been that way for a few versions yet this subject keeps popping up and people keep pretending it's FSX

 

From Zach Heylmun -a P3D dev

 

http://www.prepar3d.com/forum-5/topic/22fps-but-gpu-on-45-and-cpu-40/

 

"The reason that changing the affinity mask at runtime changes the utilization is because the application locks each of its threads to a single core, to ensure that it runs no more than one thread on any given core. When the mask is changed at runtime, those locks are removed, and the OS starts shuffling the threads around to different cores trying to balance the load. Switching a thread from one core to another has a significant overhead, and despite the OS’s best efforts, it can’t do better than give each thread its own physical core. The way the default mask works ensures that only external applications will ever contend with P3D for CPU resources, while it can and will compete with itself after the mask is changed at runtime."

 

...and another quote from Zach:

 

"We don’t elevate our process priority, so Prepar3D won’t choke other applications for processing resources. I would be very surprised if our changes to the default affinity mask caused any trouble in that respect Mr. Bob. Honestly, I would recommend giving the default configuration a good thorough chance, because we changed more than just the affinity mask to improve processor utilization. Our internal work scheduling should allow hyper threaded processors to realize improved paging performance without overloading the first physical core and lowering the frame-rate."

 

Also another few quotes from Beau:

 

http://www.prepar3d.com/forum-5/topic/does-2-3-beneift-from-hyperthreading-enabled/

 

"While there are still likely some use cases that would benefit from a custom AM, we’ve tweaked things so that the default behavior should work well on any hardware. Custom masks are probably more likely to hurt performance than to help at this point, but there are always exceptions to every rule."

 

"Yes. There are varied opinions out there of course depending on what kind of tests are being run, but you should see better paging performance using all cores. Our default affinity mask now uses all cores including HT cores. There may be some benefit to masking off the first HT core to give the primary thread more breathing room and/or masking off one core completely to trick the OS into not schedule tasks on the Prepar3D cores. All that said, the best one-size-fits-all setting we found given the current job scheduling technique is to let all cores work."

 

 

Beau Hollis

Prepar3D Rendering System Lead"

 

 

What they are telling you in short is leave it alone, but I guess some people just can't stop tinkering..

Steve McNitt
  • Commercial Member

LM put in a bunch of code since version 2.3 so you don't need to play with affinity masks anymore.

 

Been that way for a few versions yet this subject keeps popping up and people keep pretending it's FSX

 

From Zach Heylmun -a P3D dev

 

http://www.prepar3d.com/forum-5/topic/22fps-but-gpu-on-45-and-cpu-40/

 

"The reason that changing the affinity mask at runtime changes the utilization is because the application locks each of its threads to a single core, to ensure that it runs no more than one thread on any given core. When the mask is changed at runtime, those locks are removed, and the OS starts shuffling the threads around to different cores trying to balance the load. Switching a thread from one core to another has a significant overhead, and despite the OS’s best efforts, it can’t do better than give each thread its own physical core. The way the default mask works ensures that only external applications will ever contend with P3D for CPU resources, while it can and will compete with itself after the mask is changed at runtime."

 

...and another quote from Zach:

 

"We don’t elevate our process priority, so Prepar3D won’t choke other applications for processing resources. I would be very surprised if our changes to the default affinity mask caused any trouble in that respect Mr. Bob. Honestly, I would recommend giving the default configuration a good thorough chance, because we changed more than just the affinity mask to improve processor utilization. Our internal work scheduling should allow hyper threaded processors to realize improved paging performance without overloading the first physical core and lowering the frame-rate."

 

Also another few quotes from Beau:

 

http://www.prepar3d.com/forum-5/topic/does-2-3-beneift-from-hyperthreading-enabled/

 

"While there are still likely some use cases that would benefit from a custom AM, we’ve tweaked things so that the default behavior should work well on any hardware. Custom masks are probably more likely to hurt performance than to help at this point, but there are always exceptions to every rule."

 

"Yes. There are varied opinions out there of course depending on what kind of tests are being run, but you should see better paging performance using all cores. Our default affinity mask now uses all cores including HT cores. There may be some benefit to masking off the first HT core to give the primary thread more breathing room and/or masking off one core completely to trick the OS into not schedule tasks on the Prepar3D cores. All that said, the best one-size-fits-all setting we found given the current job scheduling technique is to let all cores work."

 

 

 

Beau Hollis

Prepar3D Rendering System Lead"

 

 

What they are telling you in short is leave it alone, but I guess some people just can't stop tinkering..

Pretty straightforward to run up P3D without a JOBSCHEDULER section in the cfg, and check out its affinity using Task Manager and see it in action.

Actions speak louder than words.

 

...Just double checked AM=0.

 

Tips: If we try moving threads around with Set Affinity after the sim starts we can't guarantee the same effect as if we start the app with the AM set. If we start the sim from another app, then the sim will start with the affinity of the starting app, unless measures are taken to process the affinity of the sim by the starting app.

Seems we agree on moving threads so that's good...Although I suspect you're mixing this up with the function of the jobsheduler when the app starts.

 

I guess some people just can't stop tinkering.."

I think you should come back with a better understanding of CPU affinity before posting comments on this discussion, and making inflammatory remarks for no reason is unfair.

Steve Waite: Engineer at codelegend.com

 

 


Thanks David. I made a bit of an attempt here, but I've been meaning to spruce it up for ages.

 

When i open up Task Manager i can see 12 towers,  as my machine is 6 core i now know Hyper Threading is on.  I did try the calculation before but i might as well of been counting sheep. 
I do read all the threads relating to it though and will try again, it does make sense. I will check out the link.  

 

 

 

  • Commercial Member

On your PC that might be, but please don't speak for everyone using that setting. Info like that is misleading.

 

+1

Dave Hodges

 

System Specs:  I9-13900KF, NVIDIA 4070TI, Quest 3, Multiple Displays, Lots of TERRIFIC friends, 3 cats, and a wonderfully stubborn wife.

 

 


I think you should come back with a better understanding of CPU affinity before posting comments on this discussion, and making inflammatory remarks for no reason is unfair.

 

Not trying to be inflammatory at all and I respect your opinion, but there is a lot of wrong info here and people keep perpetuating it.

 

I have a very good understanding how it works and am only pointing out that by putting in an AM you are essentially throwing away the optimizations that they put into P3D and putting it in the hands of the windows job scheduler which then starts moving threads around as it pleases. 

 

It is outright misinformation to say that setting an AM dictates which threads will run on which cores, all it does is disallow threading on certain cores.

 

All one needs to do to see this happening is open up Process Explorer and browse to the P3D process, right click it and show the properties page. On that page is a tab for "Threads" there you can see what is really happening and what is the ideal processor that a particular thread of P3D is going to try to use. 

 

Trying to use Windows task managers bar charts doesn't really tell the true story at all. 

Steve McNitt
  • Commercial Member

My friends,

 

I'm a former hardware computer engineer (US Navy, IBM Federal Systems Division) and later on a Project Manager, so I thought I'd jump in and help. For the record, I've posted the following a number of times, and I guess people don't want to here the answer.

 

I realize that people want a Plug-n-Play answer, but there simply isn't one, and I'll explain why and what individual users need (should, must) do.  One can either accept this advice, or not, I can't help that.

 

The only real answer is... (wait for it)... "It Depends".  Allow me to explain.

 

Everyone's system, no matter how similar, is different.  Different motherboards (or components on those motherboards), different processors (even if they're the same one), different heat and speed tolerances, different types of cooling systems, some people overclock (often needlessly by the way) and some don't, and people have different software running along with P3D that will also require some processor time (bandwidth).

 

What folks should (need to) do is gain a basic understanding of Hyper threading and Affinity Mask and how it applies to the processor AND what software they're running in concert with P3D.  Then test different settings under Hyper-threading and non-H/T to see what works best for them.  You can certainly start with basic recommendations, but each system configuration is different and you'll have to determine what works best for you.

 

As far as benchmarks and developing a Matrix, one would simply have to purchase many different types of hardware configurations and a lot of different FS related software in order to produce one that is accurate, and even then we'd still arrive back at "you need to test it for yourself".

 

Now I'm sorry, but this is the REAL answer to H/T and Affinity Mask. 

 

Hyper-threading and Affinity Mask are both very simple for most anyone to understand - in fact Intel used to have a video that describes Hyper-Threading with graphic representations (it's used to be on the Intel website).  Spending just a little time to learn about these excellent tools will REALLY be worth it.

 

I sincerely hope this helps those who need it.

 

All the best.

Dave Hodges

 

System Specs:  I9-13900KF, NVIDIA 4070TI, Quest 3, Multiple Displays, Lots of TERRIFIC friends, 3 cats, and a wonderfully stubborn wife.

  • Commercial Member

It is outright misinformation to say that setting an AM dictates which threads will run on which cores, all it does is disallow threading on certain cores.

Not something I've ever said, in fact I've been banging on for ages that the AM can only restrict the use of cores. But watching P3D as you say shows it unleash unnecessary threads on a many cored CPU, and that's got to be handled by an AM since P3D *does not*.

Steve Waite: Engineer at codelegend.com

Therefore I am going to test with several AM and I gues that I will probably end up with  AM=1364...

5950x3d 5.4-5.7 GHz - Asus ROG 870 Crosshair Apex - GSkill Neo 2x 24 Gb 6000 mhz / cas 26 -  MSI RTX 5090 Gaming Trio OC - 1x SSD M2 6000 2TB - 1x SSD M2 2800/1800 1Tb -  Corsair 5400  case - Corsair 360 liquid cooling set  - 3x 75’ TCL tv.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 

FOV : 200 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

  • Commercial Member

Yeah, we are starting to see 8 core and more 6 core, so it's common now to partition the required cores for the sim. Choosing higher cores in the logical order, but it does not really matter where. If you start with 1344=(01,01,01,00,00,00) that's really the minimum you want on that cpu. You may find 1364=(01,01,01,01,01,00) does not improve on that, or 3904=(11,11,01,00,00,00) works as well or better leaving more CPU for addons.

 

My friends, I'm a former hardware computer engineer...

Thanks for your insight Dave, nicely put.

 

As far as my credentials go, I'm 56 and I've been writing code since I was 15, writing code on concurrent and real time systems for the MOD, systems and weapons testing and appraisal from 21 year old, and later a short stint in Medical, then senior tech at a few computer firms for 12 years after that. I've been writing multi threaded apps on Windows since Win95.

Steve Waite: Engineer at codelegend.com

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.