Windows 10: Is there a way to set processor affinity for a process using commands invoked from within...

Discus and support Is there a way to set processor affinity for a process using commands invoked from within... in Windows 10 BSOD Crashes and Debugging to solve the problem; I have a processor/memory -intensive program that runs twice as fast if I affiniate it to a single processor. Is there a command to perform the task... Discussion in 'Windows 10 BSOD Crashes and Debugging' started by Paul Kislanko, Jan 16, 2020.

  1. Is there a way to set processor affinity for a process using commands invoked from within...


    I have a processor/memory -intensive program that runs twice as fast if I affiniate it to a single processor. Is there a command to perform the task that I currently do manually via task manager after having the program's initialization pause and ask me to do it manually via task manager?


    Microsoft Windows 10 Pro Version 10.0.18362 Build 18362


    The program is single-threaded, so doesn't benefit from having multiple logical processors, and pinning it to the highest-numbered processor tends to keep all the other processes running on the PC from disrupting its cache references. The program has access to its PID, if that helps.

    :)
     
    Paul Kislanko, Jan 16, 2020
    #1

  2. Affinity Command in CMD


    How are you implementing the command? Affinity takes a hexadecimal number.
    For exmaple:
    processor 0: 0x1
    processor 1: 0x2
    processor 2: 0x4
    processor 2 & 4: 0x14

    You can use the calculator to get these numbers. In Programmer mode, go to the bit toggling keypad.


    Is there a way to set processor affinity for a process using commands invoked from within... [​IMG]


    And before you state it. Yes this is how it worked in Windows 7 as well. Using plain decimal numbers (1-8 etc.) did not correspond to a CPU number. You just never double checked the command in task manager to make sure it set that process to the CPU you picked. I.E. using "affinity 3" did not restrict the process to processor 3. No, instead it restricted the process to CPU 0 and 1.
     
    logicearth, Jan 16, 2020
    #2
  3. Yolvi Ell Win User
    CPU / CPU Processor problems / Processor affinity

    We appreciate the information you provided. Your processor is working as expected. CPU affinity is only showing CPU (0) since 1 processor is working at the moment. It's very likely that your computer is using a balanced power plan, so we suggest changing
    your power plan to High Performance by following these steps:

    • Right-click Start.
    • Click Power Options.
    • Choose High Performance.

    In addition to that, we recommend installing the latest updates to keep your system current and secure. Go to
    Start > Settings > Update & Security > Check for updates.

    Some programs may also be automatically launching whenever you boot your computer, affecting the performance. To disable them, follow these steps:

    • Right-click your taskbar.
    • Click Task Manager.
    • Under the Startup tab, find the programs that you don't need.
    • Right-click the program and choose Disable.

    You're also using your computer for a game that was designed to run on an earlier version of Windows, so it's possible that it's slowing down your computer. In this case, use the Compatibility Troubleshooter to find and fix problems with the program using
    these steps:

    • Click Start.
    • Type Troubleshooting and press Enter.
    • Click Run programs made for previous versions of Windows.
    • Click Next.
    • Choose the program from the list and click Next.

    Let us know if you need further assistance with your computer.
     
    Yolvi Ell, Jan 16, 2020
    #3
  4. Eetheart Win User

    Is there a way to set processor affinity for a process using commands invoked from within...

    Affinity Command in CMD


    Yes, I am perfectly aware of how the hexadecimal system works with Affinity. In my case I'm trying to make said program only run on CPU 0, thus the bat file looks like this:

    Code:
    Code:
    Start /affinity 1 program.exe
    But Windows seems to ignore it, running the program with all cores. And it's not just that specific program, I've tested with multiple and it's all the same. It works just fine with the exact same command, exact same program on my Windows 8.1 PC, but not on my Windows 10.

    Maybe someone with Windows 10 can test and confirm to see if I'm the only one with this problem.
     
    Eetheart, Jan 16, 2020
    #4
Thema:

Is there a way to set processor affinity for a process using commands invoked from within...

Loading...
  1. Is there a way to set processor affinity for a process using commands invoked from within... - Similar Threads - set processor affinity

  2. CredSSP auth failing while using Invoke-Command winrm client cannot process the request

    in Windows 10 Gaming
    CredSSP auth failing while using Invoke-Command winrm client cannot process the request: Hi,I am trying to run the below powershell script using AWS ssm automation. This script will run as SSM Administrator and will try to enable the iscsi service by running the script as domain user account authenticated with CredSSP. Windows version:...
  3. CredSSP auth failing while using Invoke-Command winrm client cannot process the request

    in Windows 10 Software and Apps
    CredSSP auth failing while using Invoke-Command winrm client cannot process the request: Hi,I am trying to run the below powershell script using AWS ssm automation. This script will run as SSM Administrator and will try to enable the iscsi service by running the script as domain user account authenticated with CredSSP. Windows version:...
  4. Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...

    in Windows 10 Gaming
    Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...: Long story short, Ive tried everything. "Teredo unable to qualify" closed nat...What works, 100 percent of the time every 24 hours, is that "fix it" button. It then reports nat open, has never failed a single time in years, and no other problems at all... until 24 hours...
  5. Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...

    in Windows 10 Software and Apps
    Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...: Long story short, Ive tried everything. "Teredo unable to qualify" closed nat...What works, 100 percent of the time every 24 hours, is that "fix it" button. It then reports nat open, has never failed a single time in years, and no other problems at all... until 24 hours...
  6. Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...

    in Windows 10 Network and Sharing
    Is there a way to invoke the "Fix it" command/button that is in "Xbox Networking" in...: Long story short, Ive tried everything. "Teredo unable to qualify" closed nat...What works, 100 percent of the time every 24 hours, is that "fix it" button. It then reports nat open, has never failed a single time in years, and no other problems at all... until 24 hours...
  7. 20h2 command processor admin can't be invoked

    in Windows 10 BSOD Crashes and Debugging
    20h2 command processor admin can't be invoked: gives message "this file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default apps Setting page"...
  8. Is there a way to pre-change a process cpu affinity?

    in Windows 10 BSOD Crashes and Debugging
    Is there a way to pre-change a process cpu affinity?: I've been playing a game, but it uses all my cores and threads making my computer unstable, is there any way to change the priority of the process before it even starts? I've tried using a key in the registry to change the affinity of a process, I've tried to use a "NT...
  9. What is Processor Affinity & how to set Processor Affinity on Windows 10

    in Windows 10 News
    What is Processor Affinity & how to set Processor Affinity on Windows 10: [ATTACH] [ATTACH]When a Program runs in Windows 10, it uses CPU. Most of the computers have a multicore processor. Any Program that you run uses all the CPU cores. In simple words, Windows OS decides how to use the cores for [...] This post What is Processor Affinity & how...
  10. Affinity Command in CMD

    in Windows 10 Performance & Maintenance
    Affinity Command in CMD: In past Windows OS's , I was always able to change the CPU affinity with a simple line in a .bat file. Code: start /affinity # program.exe[/quote] # depends on which CPUs you want to run the program with. Now, in Windows 10, this command does not work. I've tried with...