CpuCollection 클래스
The CpuCollection class represents a collection of Cpu objects that represent all the CPUs that are defined on an instance of SQL Server.
상속 계층
System.Object
Microsoft.SqlServer.Management.Smo.CpuCollection
네임스페이스: Microsoft.SqlServer.Management.Smo
어셈블리: Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)
구문
‘선언
Public NotInheritable Class CpuCollection _
Implements ICollection, IEnumerable
‘사용 방법
Dim instance As CpuCollection
public sealed class CpuCollection : ICollection,
IEnumerable
public ref class CpuCollection sealed : ICollection,
IEnumerable
[<SealedAttribute>]
type CpuCollection =
class
interface ICollection
interface IEnumerable
end
public final class CpuCollection implements ICollection, IEnumerable
CpuCollection 유형에서 다음 멤버를 표시합니다.
속성
이름 | 설명 | |
---|---|---|
![]() |
AffitinizedCPUs | Gets an affinitized Cpu list. |
![]() |
Count | Gets the number of Cpu entries in the collection. |
![]() |
IsSynchronized | Gets a value that indicates whether the collection is synchronized with the instance of SQL Server. |
![]() |
Item | Gets a Cpu object from the collection. |
![]() |
SyncRoot | Gets the synchronization root of the CpuCollection object. |
맨 위로 이동
메서드
이름 | 설명 | |
---|---|---|
![]() |
CopyTo(Array, Int32) | Copies the collection of objects to a one-dimensional array beginning at the specified index value. |
![]() |
CopyTo(array<Cpu[], Int32) | Copies the collection of objects to a one-dimensional array beginning at the specified index value. |
![]() |
Equals | (Object에서 상속됨) |
![]() |
GetByID | Gets a Cpu object with the specified CPU ID from the collection. |
![]() |
GetElementAt | Gets a Cpu object from the specified position in the collection. |
![]() |
GetEnumerator | Gets a IEnumerator interface that can be used to iterate over the CpuCollection object. |
![]() |
GetHashCode | (Object에서 상속됨) |
![]() |
GetType | (Object에서 상속됨) |
![]() |
SetAffinityToAll | Sets the affinity mask for all CPUs on an instance of SQL Server. |
![]() |
SetAffinityToRange(Int32, Int32, Boolean) | Sets the affinity mask for the CPUs in the specified range. |
![]() |
SetAffinityToRange(Int32, Int32, Boolean, Boolean) | Sets the affinity mask for the CPUs in the specified range. |
![]() |
ToString | (Object에서 상속됨) |
맨 위로 이동
주의
The methods Count,
IsSynchronized,
SyncRoot and
[T:Microsoft.SqlServer.Management.Smo.CpuCollection.CopyTo(T:System.Array,T:System.Int32)] are inherited from ICollection and IEnumerable.
예
The following example shows how to display the ID of each CPU on an 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)");
dbServer.Refresh();
//Display the ID of each CPU on the instance of SQL Server.
foreach (Cpu cpu in dbServer.AffinityInfo.Cpus)
{
Console.WriteLine("Cpu ID = {0}", cpu.ID);
}
}
}
}
Powershell
$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbServer.Refresh()
#Display the ID of each CPU on the instance of SQL Server.
Foreach ($cpu in $dbServer.AffinityInfo.Cpus)
{
Write-Host "CPU ID =" $cpu.ID
}
스레드 보안
이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.