Longtime listener, first time caller... When I see all these CPU affinity discussions it seems to always be about segregating a process (not thread) to a single core, but this causes more harm than anything else. For instance, vpinballx.exe will run 5 to 8 threads just by sitting at the editor with nothing to do, and a CORE can execute a single thread at a time (more on that later). Now once you load a table and decide to play it, vpinballx.exe starts up itself as the "player" which is a duplicate process and now we have even more threads running. If the table happens to use VPinmame, then this is a THIRD process all running under the vpinballx.exe "umbrella." As a simple test I ran a modern Stern table and ended up with about 30 concurrent threads running.
CPU affinity (and IO, Memory, Priority) in this case is inherited by the launching process, the original vpinballx.exe, so whatever you have that exe set to will also set the same parameters to the player and the vpinmame processes.
So the deal about a core only able to run a single thread at a time... this is true, BUT... a core can run MULTIPLE threads concurrently through the magic of cpu "time slices" and out of order executions, etc. This is where the Windows scheduler comes in and likely knows how to run the myriad threads happening on your system (remember that vpinballx.exe isn't the only thing currently running) better than you do by forcing a process (not a thread) to sit all alone with only a single core to work with.
Okay... so when does cpu affinity make sense to manually adjust? When a program does not handle the built in latency of HT (having a core literally run 2 threads concurrently) being utilized by the system. In this case, you want to set your program to run in "Single Threaded Performance Mode," which just means to use ALL actual cpu cores and to ignore the virtual cores provided by hyper threading. If you have an Intel i7 with 4 real and 8 total "cores" (like the 3770 for instance) you would set the Affinity to 0,2,4,6 so the program only uses the real cores thereby removing itself from the possible bottleneck/latency that HT executions may cause. But really, there are much better ways to make sure your pinball plays the best it can.
Set Priority Class to HIGH
Set IO Priority to HIGH
Set Memory Priority to 5 (or NORMAL)
If you have an HT enabled CPU Set Affinity to use ALL and ONLY the actual cores.
For the Video Card (in your card software)
Set Vsync to ON (you are not conducting a video card FPS benchmark)
Set Pre-Rendered frames to 1 (lowers input lag)
Set Triple Buffering to ON (really lowers input lag)
DO NOT USE AN HDMI CABLE(s) IF YOU HAVE A 120/144hz monitor(s)
For your input device
Use a USB 3 input jack
If using a keyboard, make sure you have a "gaming" one that lets you manually set polling rate (1ms is nice) and can disable "key delay."
If using a controller like an Xbox or Playstation game pad, make sure it is a WIRELESS unit as it polls much faster (1000hz vs 125hz) than a wired unit.
If you have used the above settings and still have stuttering and/or frame delay or input lag. You need a NEW computer system (there is much more going on than just a CPU or Video Card upgrade to influence overall system performance) and for a Windows 10 system you really should have at least:
CPU - i7 7700k (all video pinball, 2d fighters and shmups like high clock rates and single threaded performance because many of the graphics routines are still handled by the CPU and keep in mind you need to be using Vsync)
Hard Drive - SSD for the OS
Video Card - At minimum an Nvidia 960, but a 970, or better yet the 1060 6GB is a good choice if you have no interest in VR.
Well this went on for longer than I had intended... and before I forget, try Process Lasso (I use the Free version myself) if you want to easily set the various parameters discussed here.
And thanks to everyone for all the hours and expertise you all bring to and hand over to this hobby, I have had years of enjoyment due to all of you and have also gained some interesting real-world applicable programming pointers from fiddling with the various tables to get them to my liking.
Cheers!
Edited by malifica, 19 April 2018 - 03:02 PM.