using System; namespace SmartCoalApplication.SystemLayer { public static class Processor { private static int logicalCpuCount; static Processor() { logicalCpuCount = ConcreteLogicalCpuCount; } public static int LogicalCpuCount { get { return logicalCpuCount; } set { if (value < 1 || value > (IntPtr.Size * 8)) { throw new ArgumentOutOfRangeException("value", value, "must be in the range [0, " + (IntPtr.Size * 8).ToString() + "]"); } logicalCpuCount = value; } } public static int ConcreteLogicalCpuCount { get { return Environment.ProcessorCount; } } } }