0

Problem: I have a single core process that has oscillating load (sc2 path optimizer).

How can I make a script that moves this process to a certain core and prevents other processes to enter that core?

My initial idea is to use command line script to monitor processes and constantly (once per sec or so) tell them to keep away from core X unless they are called sc2-path-optimizer. sc2-path-optimizer is then forced to core X and nowhere else.

Is the above feasible? I have 4 cores so I have extra computation power to do other stuff while running this core-X-dedicated process.

This is approach is suggested elsewhere, but what are the actual commands for processors affinity change (or similar) and commands for thread looping? Little nudge to right direction is needed.

https://stackoverflow.com/questions/5346692/how-to-reserve-a-core-for-one-thread-on-windows/5346714#5346714

How can I ensure that exactly one process is running on a given processor/core?

1 Answer 1

0

Partial answer:

Get and set affinity:

PowerShell "Get-Process app | Select-Object ProcessorAffinity"
PowerShell "$Process = Get-Process app; $Process.ProcessorAffinity=255"

https://stackoverflow.com/questions/19187241/change-affinity-of-process-with-windows-script

get all processes:

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ee176855(v=technet.10)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .