PDA

View Full Version : Setting Affinity



Dermmy
September 29th, 2007, 04:05 AM
Hi folks

a question from a total computer num-nut...

I have a dual core processor (or at least my computer does!). After watching Trainz running a friend suggested setting an 'affinity' between Trainz and the second processor. He suggested that Windows would then use one processor and Trainz the other, resulting in better performance.

This seems a quick easy change, but one I have never seen suggested in these hallowed halls. And I suspect my friends computer savvy is at best minimally superior to my own.

Any comments?

Andy :)

big_b
September 29th, 2007, 04:40 AM
Never tried it but was thinking about the same thing myself
Control Alt Del to open task manager.
Then go to processes
Right click on the TRainz process & you will see Set Affinity
Click on it & you will see your CPU's & how the process is using them.
Looks like you just tick the processor you want to control that process

I'll let you do it first before I try since you asked first.

Dave

pommie
September 29th, 2007, 05:43 AM
What I do, after loading a map, set trainz priority to above normal, then set trainz affinity to one of the cores, after trainz settles down then take set the affinity back to both cores.
If you get the same result as me you then have trainz using both cores, its easy to check, if trainz is using more than 50%cpu its using both cores.
The only downside to this is you have to redo it every time you swap maps.

Cheers David

sethmcs
September 29th, 2007, 01:37 PM
Can somebody explain this dual core stuff? I was under the impression that to effectively use dual core you need 1) software that is designed for dual core(64bit) 2) an operating system that is designed for dual core (Vi$ta?) 3) a dual core CPU.

However I suspect that the CPU uses both cores without 64bit software or Vista. Maybe not as efficiently as with software and OS optimized.

john259
September 29th, 2007, 02:55 PM
You don't seem to need either Dual Core or Vista.

I've got an Intel Pentium 4 processor with HyperThreading enabled, running WinXP Home Edition SP2. When I right-click on a process in Windows Task Manager I get a Set Affinity option, and it shows all the processes I've checked as by default being allowed to run on CPU0 and CPU1.

Confused? I was already :)

John

overmars
September 29th, 2007, 04:29 PM
I had a play with this the ages ago and didnt see any performance gain what so ever.Anyone else have?

sethmcs
September 30th, 2007, 12:31 AM
I had a play with this the ages ago and didnt see any performance gain what so ever.Anyone else have?

Dual Core Just Hipe or a Breakthrough? Anyones thoughts?:o

JCitron
September 30th, 2007, 12:45 AM
The dual core processors are really two seperate processors on the same substrate. The purpose of this is to increase the bandwidth between two processors so the system can work faster. In the old days, prior to the dual core stuff, 2 indvidual processors were installed. I have an old Dual Processor system. This has 2 PIII 866 Mhz processors on it, and 2 gig of RAM. The problem with the 2 seperate processors working in tandem is that there is a great distance between to processors so the memory and data piplelines are a lot slower. The reason for the slowness is due to crosstalk between the etches on the motherboard. By placing the dual processors on one chip, Intel has eliminated the extra circuitry required to connect the processors together, and have been able to increase the core speed and the buss speed between the two processors.

The current crop of operating systems, starting NT upwards is capable of utilizing both processors. It's the applications that need to be written to specifially support the two processors.

The applications that utilize this ability are usually those that require intensive math calculations such as CAD-CAM, and 3d modelling applications. A few years ago, I used a program called World Builder from Digital Element. This program used both Cpus on my dual 866 Mhz motherboard. The rendering time per frame, decreased from 21 minutes to less than 12 per frame. This is a significant improvement in processing.

John

JCitron
September 30th, 2007, 12:50 AM
Never tried it but was thinking about the same thing myself
Control Alt Del to open task manager.
Then go to processes
Right click on the TRainz process & you will see Set Affinity
Click on it & you will see your CPU's & how the process is using them.
Looks like you just tick the processor you want to control that process

I'll let you do it first before I try since you asked first.

Dave

Try Ctl-Alt-ESC. This will just bring up the task manager instead of changing the display to the logout/task manager. (Trainz will minimize).

I find that I've had fewer crashes doing it this way because when exiting to the task manager, the video sometimes has a difficult time recovering.

John

sethmcs
September 30th, 2007, 12:56 AM
Is dual core like CPU and math coprocessor of old?

john259
September 30th, 2007, 01:19 AM
Is dual core like CPU and math coprocessor of old?
As I vaguely understand it, yes, but far more so. The math coprocessor only performed that function, albeit a critically important one.

Don't forget there's another processor involved especially when running any 3D program such as Trainz, namely the graphics processor on the video board, doing the vast number of lighting and shading calculations. Would it be fair to say that in modern video boards the graphics processor's power is now approaching that of the main processor and just as important, or is that an overstatement?

John

eldavo
September 30th, 2007, 07:03 AM
Is dual core like CPU and math coprocessor of old?

No. Dual core processors are 2 complete processors on a single chip. They are not specialised as in the case of coprocessors or graphics processors simply 2 identical general purpose processors.

IMHO setting affinity probably doesn't help unless you get into some detailed settings. In fact it might hinder performance as left to it's own devices the operating system will schedule any available processor to a process that is able to run. Setting affinity will mean (I think!) that if the chosen processor has been scheduled to run another task (antivirus, firewall, or any of hundreds in the Windows system) Trainz will have to wait for it to come free. The only possible benefit is if you can restrict the processor from running anything else but Trainz in which case the cache etc. will be nicely preloaded and it will always be available to run.

Cheers
Dave