Share via

How do I set a program to run on only a single core of my multi-core computer?

Anonymous
2009-04-29T05:37:06+00:00

Hi,

I have a multiple core computer, but one very CPU-intensive program that is only designed to run on a single core (maybe you've heard of it; Dwarf Fortress. If not, it's not really necessary, but hey). Now I'm wondering, how can I set the program to only run on a single core every time I start it up? I have a shortcut on my desktop, so if it's not possible to change in the program parameters or other such stuff in Windows itself, I do have the option of modifying the shortcut to make it run on one core.

Windows for home | Previous Windows versions | Apps

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2009-04-29T15:10:23+00:00

Hello Drake1500,

 Thank you for using Microsoft Windows Vista Forums.

 Since each program/software is set up differently to run on mulit or single core processing there is nothing Vista can do to change that.  You would have to somehow change the format of the program itself.  I have attached a link below that does talk about this issue.  Please let me know if you have any other questions.

 http://msdn.microsoft.com/en-us/magazine/cc163340.aspx

Optimize Managed Code For Multi-Core Machines


James Microsoft Answers Support Engineer Visit our Microsoft Answers Feedback Forum and let us know what you think.

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-05-24T19:57:27+00:00

    I know this thread is a bit old, but it's still useful. However, at least in Win7, start needs to be run with the /wait option as well to work properly.

    i.e. c:\Windows\System32\cmd.exe /C start /wait /affinity 1 "<path/to/program.exe>" <program options>

    Or a real example:

    c:\Windows\System32\cmd.exe /C start /wait /affinity 1 "c:\Program Files (x86)\Maxis\SimCity 4 Deluxe\Apps\SimCity 4.exe" -intro:off

    Without the /wait option, the program being run closes immediately and you end up opening a Command Prompt window instead.

    But now I can play SimCity 4 without crashes. :)

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2009-05-08T23:04:48+00:00

    Hi Drake,

    You've got 2 options.

    Change the running function by opening task manager (ctrl+alt+delete and choose start task manager) then find the process and right-click over it. Then the dialog pops up to set affinity. I would start by trying core 0 first.

    Set it before you run the program. You can also create a shortcut and include the affinity command.

    Here is a sample for running notepad on a single core.

    c:\windows\system32\cmd.exe /C start /affinity 0 notepad.exe (This is for core 0.)

    c:\windows\system32\cmd.exe /C start /affinity 1 notepad.exe (This is for core 1.)

    Possibly your program itself may come with command line parameters you can set. (Yeah, okay that's 3 technically)


    Matt Hudson

    Microsoft Answers Support Engineer

    Visit our Microsoft Answers Feedback Forum and let us know what you think.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2009-04-30T04:29:09+00:00

    Hi James,

    Thanks for the information, but I think you misunderstood what I meant. This might be my fault, maybe I was unclear in the question, and I apologize for that. What I want is to know how to set Dwarf Fortress to have affinity to a single core, every time I run it, automatically. I know I can go into Task Manager, once it is open, and then set it to have affinity to a single core from there, but as I understand it, I will have to do that every time I start up the game. What I want is to eliminate this step, so that when I run DF, it automatically runs with affinity to a single core.

    Dwarf Fortress only uses one core. I know this for a fact. Others have said that it helps to set the game to run on only a single core, rather than having it switch back and forth between the cores (it is very CPU intensive).

    So, my question is: How do I set a program that only runs on a single core, to always have affinity to a single core? Is this even possible, or will I have to manually set affinity every time I start the program up?

    Thanks,

    Drake

    Was this answer helpful?

    0 comments No comments