I need help to figure out how to run my program using only one processor...I'm using AMD Athlon(tm) II Dual-Core M320 and will like to disable the other processor from running.. I only need one core to execute my code..
I need help to figure out how to run my program using only one processor...I'm using AMD Athlon(tm) II Dual-Core M320 and will like to disable the other processor from running.. I only need one core to execute my code..
Unless you deliberately write your program to be multi-threaded then it'll only use a single core. You can't stop other processes from using the other core while your stuff is running though.
If you want to run your computer using just one CPU, then you could boot using "maxcpus=1". See also this thread.
If you want to have your computer running normally but force your program to only use one CPU, and not have the scheduler change CPU's sometimes then do (to use CPU 0)Code:taskset -c 0 ./your_program
Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.
Thank.. It work perfectly.
Bookmarks