|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Sep 2004
Age: 37
Posts: 1,006
|
In the Main method (svn 187), there's some logic to test for multiple processors. The original code is all at the (relative) beginning of the main method (starts at ~ line 410):
Code:
int processorCount = Environment.ProcessorCount;
if( processorCount > 1 )
m_MultiProcessor = true;
if( m_MultiProcessor || Is64Bit )
Console.WriteLine( "Core: Optimizing for {0} {2}processor{1}", processorCount, processorCount == 1 ? "" : "s", Is64Bit ? "64-bit " : "" );
m_ProcessorCount = processorCount;
Code:
private static bool m_MultiProcessor; private static int m_ProcessorCount; Code:
private static bool m_MultiProcessor;
public static bool MultiProcessor
{
get
{
if(Environment.ProcessorCount > 1)
m_MultiProcessor = true;
else
m_MultiProcessor = false;
return m_MultiProcessor;
}
set
{
m_MultiProcessor = value;
}
}
and then all that's needed in the main method is: Code:
if(MultiProcessor || Is64Bit)
Console.WriteLine("Core: Optimizing for {0} {2}processor{1}", processorCount, processorCount == 1 ? "" : "s", Is64Bit ? "64-bit " : "");
|
|
|
|
|
|
#2 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,760
|
Its all relative, but if your trying to point out these semi-useless quirks(which is all just coding preference tbh) why didnt you go into 100% constructive detail and just do
Code:
public static bool MultiProcessor
{
get
{
return (Environment.ProcessorCount > 1);
}
}
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO Last edited by Jeff; 07-09-2007 at 03:22 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|