Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bind process to a CPU core
Message
From
09/05/2022 06:21:07
 
 
To
07/05/2022 17:56:51
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01684340
Message ID:
01684355
Views:
49
@Barry: look for embolded on alternative approach

Hi Al,
>Agreed.
Yupp, we probably only categorize things not the same:

>Re VFP: yes, a VFP EXE will typically run in a single thread but (to name some):
>- many talk to an RDBMS back-end

if RDBMS runs on same machine, this would fall in the group of processes (perhaps) needing special treatment as part-dependant of the vfp thread - I mentioned AV and FW only.

>- the VFP runtime makes Windows system calls

those are most of the time synched - yes, perhaps pushing cached lines to disk might be faster if this OS routine runs on same core - really no idea.

>- AV is probably keeping an eye on what's happening

And I gave it "special treatment" ;-)

>One could set processor affinity for the VFP EXE, but if the effects on other required components are unknown, will overall performance of the VFP app be improved? One would need to test extensively, and the results will probably not be repeatable on different computers.
>
>There are lots of variables, and new ones pop up from time to time. One recent example is Intel's architecture change in Alder Lake and later CPUs, with so-called P-cores and E-cores no longer being truly symmetric. This has prompted Intel to implement a "Thread Director" in the CPU itself, and Microsoft to make corresponding updates to the scheduler in Windows 11: https://www.anandtech.com/show/16959/intel-innovation-alder-lake-november-4th/3 . One might think that a "hybrid" architecture like this would be a great candidate for processor affinity but I can't immediately find any testing or recommendations for using it on Alder Lake. At first glance it looks like Thread Director and the Windows scheduler do a "good enough" job.

Barry had not given specific reason, but from my POV only perf makes sense. Turbo cores more important than energy saving, which I guess is target of newer architecture. So I left out Alder Lake energy saving cores. BTW: nice article, goes into much more detail even on the "old stuff" than lazy me.

When reading about the classes now supported, a possible step in between for Barry:
instead of tweaking core affinity, why not elevate thread priority of the vfp process ?

If task is not "many vfp processes best" but "finish single vfp process ASAP", process prio makes sense.
This should steer this process to fastest core and perhaps run OS / WINAPI called from that thread better.

>
>And, I think that's in itself a significant point. If there were big gains to be had (and no other drawbacks) by using processor affinity, there would be lots of "how-to" guides. I, for one, haven't seen anything that looks (to me) well-researched and solid. There are some posts such as https://www.youtube.com/watch?v=pKS1eLiR-Vk from gamers, cryptominers and others who need or want to squeeze the most out of their hardware but results I've seen have not been impressive.
>
>"Process Lasso" is available for Windows for those who want to play around with this sort of thing i.e. second-guess the Windows scheduler: https://en.wikipedia.org/wiki/Process_Lasso . I've never used it, not having worked with systems that are persistently CPU-bound; the bottlenecks have always been elsewhere. I believe it's a good idea to heed the caveats about it in the Wiki article - "use at your own risk".
>
Crypto miners aim to use all cores - which I interpreted this was not about ;-)

The video was on gaming - disabling SMT and getting better results on multi core
fits right into the often heard hint to buy single thread-cored (i3, i5) for gaming.

My "bang for the buck" opinion follows your ideas a lot ;-)

regards
thomas

pKS1eLiR-Vk
Previous
Reply
Map
View

Click here to load this message in the networking platform