CpuCollection.AffitinizedCPUs CpuCollection.AffitinizedCPUs CpuCollection.AffitinizedCPUs Property


Gets an affinitized Cpu list.

 property System::Collections::IEnumerable ^ AffitinizedCPUs { System::Collections::IEnumerable ^ get(); };
public System.Collections.IEnumerable AffitinizedCPUs { get; }
Public ReadOnly Property AffitinizedCPUs As IEnumerable
Property Value

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.


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);  

Applies to