CpuCollection.AffitinizedCPUs 属性

Gets an affinitized Cpu list.

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public ReadOnly Property AffitinizedCPUs As IEnumerable 
    Get
用法
Dim instance As CpuCollection 
Dim value As IEnumerable 

value = instance.AffitinizedCPUs
public IEnumerable AffitinizedCPUs { get; }
public:
property IEnumerable^ AffitinizedCPUs {
    IEnumerable^ get ();
}
member AffitinizedCPUs : IEnumerable
function get AffitinizedCPUs () : IEnumerable

属性值

类型:System.Collections.IEnumerable
Returns an IEnumerable Cpu list.

示例

The following example shows how to get an enumerable list of CPUs for an instance of SQL Server that are affinitized . Then the example enumerates the list to display information about each CPU.

C#

using System;
using System.Collections.Specialized;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server(".\\MSSQLG64");

            System.Collections.IEnumerable iEnumerableAffinitizedCpus
                = dbServer.AffinityInfo.Cpus.AffinitizedCPUs;
            System.Collections.IEnumerator iEnumerator = iEnumerableAffinitizedCpus.GetEnumerator();

            while (iEnumerator.MoveNext())
            {
                Cpu cpu = (Cpu)iEnumerator.Current;
                Console.WriteLine("cpu.ID = {0} cpu.AffinityMask = {1}",
                    cpu.ID, cpu.AffinityMask);
            }
        }
    }
}

请参阅

参考

CpuCollection 类

Microsoft.SqlServer.Management.Smo 命名空间