Jump to content
Sign in to follow this  
GoofySpetz

Why no start optimizing for smp & smt

Recommended Posts

Is this OT?

Anyway what I would really like BIS to do, is to optimize the gamecode so that the gamers with über-machines (Now that would include me) could take advantage of having SMP / SMT.

Maybe the extra resources could be used to better the AI, or whatnot.

This has probably been asked before but BIS........pretty please with sugar on top.

ANother cool thing would be if the GFX chip vendors would optimize their drivers to utilize SMP/SMT if possible.

But the coolest would prolly be if on CPU took care of AI and world interaction and the second CPU would do the GFX....

Any of this feasible?confused.gif?

wink.gif

Share this post


Link to post
Share on other sites

Mr. Goofy is probably refering to Symmetric Multi Proccessing and Simultaneous Multi Threading, like dual cpus and the intel PIV Xeon's novel way of having two logical processors ondie.

But hey, that would be cool since SMT is going to be mainstream sometime in 2003 when Intel will release the next mainstream PIV CPU built on a 0.09 micron process.

Share this post


Link to post
Share on other sites

It probably wouldn't be that hard to achieve some of what you asked for using a user-developed program.

All you would need to do is identify what each thread in OFP does, and then change the Processor Affinity Mask for the thread(s) to force them onto a specific CPU or set of CPUs.

Windows has APIs to enumerate the threads in a given process, and you could obtain read-only access to the pages containing the code for the thread function. By examining what the code does, you could figure out if the thread handles AI, user interface interaction, graphics etc.

Share this post


Link to post
Share on other sites

Are you sure the OS won't automatically load-balance with the different threads? I seem to recall reading somewhere that an OS like Windows will figure out where to execute a given thread by seeing which processor has the most free processing time and putting it there.

I could be wrong however. Also, it may be that the AI and stuff isn't in a different thread.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Ender @ July 26 2002,12:33)</td></tr><tr><td id="QUOTE">Are you sure the OS won't automatically load-balance with the different threads? I seem to recall reading somewhere that an OS like Windows will figure out where to execute a given thread by seeing which processor has the most free processing time and putting it there.

I could be wrong however. Also, it may be that the AI and stuff isn't in a different thread.<span id='postcolor'>

No, you are correct, Windows NT/2000/XP with an MPS HAL will by default load-balance processes and threads across all available processors based on their utilization.

However, a Processor Affinity Mask (PAM) lets you override the behavior. I've written a program which does just that, it can launch a program on a user-specified processor, and keep it there. It can also dynamically move processes around if they are already loaded.

A PAM exists for both processes and threads. The PAM is a 32-bit mask indicating which processor(s) the process or thread is allowed to run on -- if the bit is set, execution is permitted on the corresponding processor, and if it is cleared, it will not be permitted to execute.

Share this post


Link to post
Share on other sites

Do you know if the OS can override the PAM when the app is running? I'm thinking a sort-of on-demand CPU balancer but if the OS can override it, there isn't much point.

Not the most useful idea, but it gives me something to code in my spare time. smile.gif

Mister Frag, you sound quite knowledgable, you are a fellow developer I take it?

Share this post


Link to post
Share on other sites

This is a great discussion, but really fits better under 'Troubleshooting'

Mr Frag, do you know where to find a good primer/howto-ish sort of thing on SMP/SMT?

And dont forget that the OS also determines the ability of the processor to this as well...

ie No SMP/SMT on Win98/XP Home/XP Pro, correct?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×