Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Managing Processor Affinity  (Read 1159 times)

dragonshardz

  • Bay Watcher
  • [ETHIC:PONY:ACCEPTABLE]
    • View Profile
    • Steam Profile
Managing Processor Affinity
« on: March 04, 2011, 12:10:02 pm »

I run a few old games on my quad-core laptop, and I noticed recently that when I set them to run on just one processor, instead of any of the four, performance is a lot better.

The problem is that it is very, very annoying to continually go into Windows Task Manager and set the Windows processes to not run on one processor while the game in question runs on that now-isolated processor.

I'm looking for a program that will allow me to set the Windows processes to automatically run on just one or two processors, and set programs to automatically run on one of the unused processors.

I've done some Googling, looking for a processor affinity manager, but haven't found anything good. My uncle mentioned one utility that does what I want really well, but he can't remember the name of it. So...I can't really find it.

Any recommendations, Bay12?

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Managing Processor Affinity
« Reply #1 on: March 04, 2011, 12:15:19 pm »

SMP Seesaw Pro is one I seem to have on my PC. I remember using it at some point for DF. In any case, it's free, and a quick google shows some downloads of it.

Edit: Trying it out, a simple right click, "Isolate on CPU" and you got exactly what you need in 6 clicks, including the clicks to open and close the window for it. :)

Edit2: It will need to be set each time though it seems, as it only affects that particular instance of the program, and will need to be reset after finishing if you want to free up the isolated core for further use. Still, beats changing the affinity for every process through task manager.
« Last Edit: March 04, 2011, 12:26:24 pm by alway »
Logged

Pnx

  • Bay Watcher
    • View Profile
Re: Managing Processor Affinity
« Reply #2 on: March 04, 2011, 12:49:17 pm »

Ahh the joys of multithreading on multiple core cpu's.
Logged

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Managing Processor Affinity
« Reply #3 on: March 06, 2011, 11:20:22 am »

The reason for multi-core CPU architectures is because single cores end up getting too hot above certain clock speeds IIRC. GPU's on the other hand are highly parallel because they must deal with large quantities of simple, repeated instructions. As someone who has done some multi-threaded programming, it can be a pain and a half to do right, for various reasons. CPU's can give up processing time to another thing trying to run at any time in between operations. Most lines of code in a modern program are actually multiple operations; as such your program may pause for a millisecond or two right in the middle of executing a line of code for another chunk of something to run for that millisecond. This is normally not too much of a problem except in cases in which data from one part depends on data in the other. This can lead to odd results, and thus a need for control over the flow of multiple functions running simultaneously. To avoid getting into specifics, certain special operations were created which allow for inter-thread communication  in various ways to tell each when it should and should not continue (similar to several trains running on the same track controlled by signals). These need to be set up correctly, since if they are not, strange bugs will be introduced which are not only very rare, but also as a result of their rarity incredibly difficult to trace back to their source in many cases. With single-threaded applications, you have a clear program flow of "this line, then this line, then this line," whereas with multi-threaded programming you must think of every possible combination of functions which could run at the same time which would interfere with one another's ability to do what they are supposed to.

For most applications, the software doesn't need to be multi-threaded since it can't even make use of a full core, let alone 2, 4, or 8. More and more games, though, are being made multi-threaded; some even make use of CUDA, which is another can of beans entirely (CUDA involves running part of your program on the GPU, rather than CPU; most GPUs have much more overall processing power than CPUs, but their architecture is much more specialized and has hundreds of cores which individually are slower than CPU cores).

tldr version: play OTTD and put several trains on the same line, moderate them with signals, and you get roughly the same experience as multi-threaded programming without the code
Logged

RedKing

  • Bay Watcher
  • hoo hoo motherfucker
    • View Profile
Re: Managing Processor Affinity
« Reply #4 on: March 06, 2011, 11:39:42 am »

Well malty threading cpu's are designed for better performance but the thing is that are software support are not available yet thats why we are not getting out  the full performance .....

Mmm....malty CPU's. With just a touch of hops.
Logged

Remember, knowledge is power. The power to make other people feel stupid.
Quote from: Neil DeGrasse Tyson
Science is like an inoculation against charlatans who would have you believe whatever it is they tell you.

Earthquake Damage

  • Bay Watcher
    • View Profile
Re: Managing Processor Affinity
« Reply #5 on: March 06, 2011, 01:08:12 pm »

ImageCFG might help.  It won't force all Windows processes to a particular core, which is a terrible idea anyway, but it should let you restrict a game to whichever core(s) you like.
Logged