Multiple Processor test logic in Main()
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):
For the field definitions, the original is:
it's probably better to do:
(hungarian notation... *puke*)
and then all that's needed in the main method is:
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;
For the field definitions, the original is:
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 " : "");