다음을 통해 공유


Cpu 클래스

The Cpu class contains information about one CPU on an instance of SQL Server.

상속 계층

System. . :: . .Object
  Microsoft.SqlServer.Management.Smo..::..Cpu

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public NotInheritable Class Cpu
‘사용 방법
Dim instance As Cpu
public sealed class Cpu
public ref class Cpu sealed
[<SealedAttribute>]
type Cpu =  class end
public final class Cpu

Cpu 유형에서 다음 멤버를 표시합니다.

속성

  이름 설명
공용 속성 AffinityMask Gets or sets the AffinityMask member of the Cpu class.
공용 속성 GroupID Gets the current value of the GroupID member.
공용 속성 ID Gets the ID of the CPU that is represented by this Cpu object.
공용 속성 NumaNodeID Gets the NumaNodeID of the NUMA node to which this Cpu object belongs.

맨 위로 이동

메서드

  이름 설명
공용 메서드 Equals (Object에서 상속됨)
보호된 메서드 Finalize (Object에서 상속됨)
공용 메서드 GetHashCode (Object에서 상속됨)
공용 메서드 GetType (Object에서 상속됨)
보호된 메서드 MemberwiseClone (Object에서 상속됨)
공용 메서드 ToString (Object에서 상속됨)

맨 위로 이동

주의

Access to the CPU class is though the Cpus collection property.

To change the CPU settings on an instance of SQL Server, users must have ALTER permission on the database.

The following code example displays the total number of CPUs on the local instance of SQL Server.

C#

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

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server("(local)");
            Console.WriteLine(
                "Total number of CPUs for server {0} is {1}.",
                dbServer.Name,
                dbServer.AffinityInfo.Cpus.Count);
        }
    }
}

Powershell

$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "Total number of CPUs for server" $dbServer.Name "is" $dbServer.AffinityInfo.Cpus.Count

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.