共用方式為


NumaNode.Cpus 屬性

Gets a collection of Cpu objects that belong to this NumaNode object.

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public ReadOnly Property Cpus As CpuCollection 
    Get
'用途
Dim instance As NumaNode 
Dim value As CpuCollection 

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

屬性值

型別:Microsoft.SqlServer.Management.Smo.CpuCollection
A CpuCollection that contains one entry for each CPU that belongs to this NUMA node.

備註

The Cpus property is read-only. A new CPU collection will be created when null is assigned to this property. The collection is initialized with the information from the parent AffinityInfo object.

[!附註]

Although the Cpusis read-only, the individual Cpu elements can be written to.

範例

The following example shows how to display the total number of CPUs that belong to each NUMA node on the local instance of SQL Server.

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

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server("(local)");
            dbServer.Refresh();
            foreach (NumaNode node in dbServer.AffinityInfo.NumaNodes)
            {
                Console.WriteLine(
                   "There are {0} CPUs in NUMA node {1}.",
                    node.Cpus.Count, node.ID);
            }
        }
    }
}

請參閱

參考

NumaNode 類別

Microsoft.SqlServer.Management.Smo 命名空間