Force application to run on single CPU core using C++
Go to solution
Solved by vanished,
4 minutes ago, Anand_Geforce said:Can you also give me an example snippet of code, for how to use this function? Also what if I want to set the process' affinity to only one core, but it can be any one - how can it be done?
Thanks a lot!
If you want it to only use one core worth of power and don't care which core it is, that's basically the default behaviour. You'd have to put in work to accomplish anything else, but that is how it will run by default. I mean, the Windows scheduler will probably spread out the load so it looks like it's loading all cores a little bit, but it's the equivalent of one core being pinned.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now