Results 1 to 4 of 4

Thread: Set Affinity using command prompt?

  1. #1
    zachlr1@gmail.com Guest

    Set Affinity using command prompt?

    Is there a way to set a process affinity using command prompt? I
    would like to make a .bat for setting all unimportant processes to
    core 0, and all my games to both. And then to set all processes to
    both cores when I am finished playing.
    Also is this available on XP? My friend is looking to do the same
    thing on XP.

    Thanks,
    Zach

  2. #2
    PNutts Guest

    RE: Set Affinity using command prompt?

    Hi Zach:

    A quick Google
    http://www.google.com/search?hl=en&q=vista+cpu+affinity

    turned up

    http://www.howtogeek.com/howto/windo...windows-vista/

    which sounds like it might be what you want?

  3. #3
    zachlr1@gmail.com Guest

    Re: Set Affinity using command prompt?

    What I get from that is that you use that command to start a process
    in a given affinity. Correct? However, I am looking to change the
    affinity of a given process that is already running, and cannot be
    restarted. This way, before I start a game, I can run the .bat file
    to change all of the given processes to affinity on core 0, and games
    on core 1. Then change back to normal once I am finished. I know
    that you can do this with task manager and right clicking each
    individual process, but this is very time consuming and inconvenient.
    I say command prompt because I thought of automating it with a .bat
    file, but if you know of any other (free) programs that deal with
    affinity, please let me know.

  4. #4
    Andrew McLaren Guest

    Re: Set Affinity using command prompt?

    You can change the affinity using the GUI, ie Task Manager. Select the
    Processes tab, highlight the process you want, right-click, and choose
    "Affinity" from the context menu. This lets you change the affinity of the
    running process.

    There is no command-line tool to perform the same operation. You might be
    able to do it with WMI Scripting.

    Affinity is widely misunderstood. If your goal is to get better performance
    for the game, you're probably wasting your time. Contrary to the simplistic
    view, setting affinity does not generally improve performance. The unit of
    scheduling in NT (including, here, Vista) is the Thread, not the Process. By
    hard-binding a Process to a single CPU, you're actually lowering the chances
    that the process's Threads will be scheduled to run. Besides, many or most
    games are single-threaded anyway (they will only run on a single CPU, even
    in multi-proc machines).

    A couple of years ago I did a detailed performance analysis of a web
    application (online banking) which a customer wanted to "optimise" it by
    setting the affinity. After a week with Perfmon, the conclusion was that
    there was no performance benefit whatever, and in fact a performance drop in
    several scenarios, when a process is bound to a single CPU. The NT Scheduler
    is pretty smart, and can be relied on to make good scheduling decisions in
    most cases. If you have a performance bottleneck, it won't be because your
    game is being starved for CPU. Or if it is, just close down the other
    running processes before you start the game - that will be the more relaible
    and effective way to get more CPU.

    The main benefit of setting affinity is to provide comptibility for apps
    which don't run well on multi-proc machines; you can fool them into thinking
    they are running on a single proc machine.

    You could try increasing the Priority of the game, so that it gets scheduled
    to run at a higher probability - but again, the nett effect of this is often
    less than obvious, and in most interactive applications, doesn't provide a
    tangible benefit.

Similar Threads

  1. command prompt problem
    By arshadmahmood in forum Operating Systems
    Replies: 1
    Last Post: 03-07-2010, 12:33 AM
  2. Start avg from command prompt
    By NSA_CIA in forum Operating Systems
    Replies: 2
    Last Post: 16-06-2009, 10:20 AM
  3. Missing Command Prompt
    By Maximilian5 in forum Windows Software
    Replies: 3
    Last Post: 27-05-2009, 03:21 PM
  4. about the command prompt
    By Gorganzola in forum Windows Software
    Replies: 2
    Last Post: 17-10-2008, 06:24 PM
  5. Command prompt "COPY" command not working in brand new Windows Vis
    By CMD COPY command not working in Vista in forum Vista Help
    Replies: 7
    Last Post: 06-02-2008, 02:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,568,419.12749 seconds with 17 queries