NumaNode.Cpus Property


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

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public CpuCollection Cpus { get; }

Property Value

Type: 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 T:Microsoft.SqlServer.Managment.Smo.AffinityInfo object.


Although the P:Microsoft.SqlServer.Management.Smo.NumaNode.Cpus is 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)");
            foreach (NumaNode node in dbServer.AffinityInfo.NumaNodes)
                   "There are {0} CPUs in NUMA node {1}.",
                    node.Cpus.Count, node.ID);
Return to top