ConcurrentDictionary<TKey,TValue> Constructors

Definition

System.Collections.Concurrent.ConcurrentDictionary\`2 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class.

Overloads

ConcurrentDictionary<TKey,TValue>()

기본 동시성 수준과 기본 초기 용량을 갖고 있으며 키 형식에 대한 기본 비교자를 사용하는 빈 ConcurrentDictionary<TKey,TValue> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type.

ConcurrentDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

지정된 ConcurrentDictionary<TKey,TValue>에서 복사된 요소를 포함하고, 기본 동시성 수준과 기본 초기 용량을 갖고 있으며, 키 형식에 대한 기본 비교자를 사용하는 IEnumerable<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable<T>, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type.

ConcurrentDictionary<TKey,TValue>(IEqualityComparer<TKey>)

기본 동시성 수준과 용량을 갖고 있고 지정된 ConcurrentDictionary<TKey,TValue>를 사용하는 비어 있는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the default concurrency level and capacity, and uses the specified IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>)

지정된 ConcurrentDictionary<TKey,TValue>에서 복사된 요소가 포함되어 있고, 기본 동시성 수준과 기본 초기 용량을 가지며, 지정된 IEnumerable를 사용하는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable has the default concurrency level, has the default initial capacity, and uses the specified IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

지정된 동시성 수준과 용량을 갖고 있으며 키 형식에 대한 기본 비교자를 사용하는 비어 있는 ConcurrentDictionary<TKey,TValue> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the key type.

ConcurrentDictionary<TKey,TValue>(Int32, IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>)

지정한 ConcurrentDictionary<TKey,TValue>에서 복사된 요소를 포함하고 지정한 IEnumerable을 사용하는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable, and uses the specified IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>(Int32, Int32, IEqualityComparer<TKey>)

지정된 동시성 수준과 지정된 초기 용량을 갖고 있고 지정된 ConcurrentDictionary<TKey,TValue>를 사용하는 빈 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the specified concurrency level, has the specified initial capacity, and uses the specified IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>()

기본 동시성 수준과 기본 초기 용량을 갖고 있으며 키 형식에 대한 기본 비교자를 사용하는 빈 ConcurrentDictionary<TKey,TValue> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type.

public:
 ConcurrentDictionary();
public ConcurrentDictionary ();
Public Sub New ()

Remarks

기본 동시성 수준과 Cpu 수와 같습니다.The default concurrency level is equal to the number of CPUs. 더 높은 동시성 수준이, 더 많은 동시 쓰기 작업을 간섭 하 고 차단 하지 않고 수행할 수 있습니다.The higher the concurrency level is, the more concurrent write operations can take place without interference and blocking. 또한 동시성 수준 값이 높으면 모든 잠금이 필요한 작업 (예: 테이블 크기 조정, ToArrayCount)이 더 비쌉니다.Higher concurrency level values also cause operations that require all locks (for example, table resizing, ToArray and Count) to become more expensive. 초기 버킷 수를 나타내는 기본 용량 (DEFAULT_CAPACITY) 매우 작은 사전의 크기 및 크기 조정 수 사이의 절충 값을 때 큰 사전을 생성 합니다.The default capacity (DEFAULT_CAPACITY), which represents the initial number of buckets, is a trade-off between the size of a very small dictionary and the number of resizes when constructing a large dictionary. 또한 용량 작은 소수를 나눌 수 없습니다.Also, the capacity should not be divisible by a small prime number. 기본 용량은 31입니다.The default capacity is 31.

See also

ConcurrentDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

지정된 ConcurrentDictionary<TKey,TValue>에서 복사된 요소를 포함하고, 기본 동시성 수준과 기본 초기 용량을 갖고 있으며, 키 형식에 대한 기본 비교자를 사용하는 IEnumerable<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable<T>, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type.

public:
 ConcurrentDictionary(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ collection);
public ConcurrentDictionary (System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> collection);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (collection As IEnumerable(Of KeyValuePair(Of TKey, TValue)))

Parameters

collection
IEnumerable<KeyValuePair<TKey,TValue>>

요소가 새 IEnumerable<T>에 복사되는 ConcurrentDictionary<TKey,TValue>입니다.The IEnumerable<T> whose elements are copied to the new ConcurrentDictionary<TKey,TValue>.

Exceptions

collection 또는 해당 키 중 하나는 null입니다.collection or any of its keys is null.

collection에 중복 키가 하나 이상 포함된 경우collection contains one or more duplicate keys.

See also

ConcurrentDictionary<TKey,TValue>(IEqualityComparer<TKey>)

기본 동시성 수준과 용량을 갖고 있고 지정된 ConcurrentDictionary<TKey,TValue>를 사용하는 비어 있는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the default concurrency level and capacity, and uses the specified IEqualityComparer<T>.

public:
 ConcurrentDictionary(System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public ConcurrentDictionary (System.Collections.Generic.IEqualityComparer<TKey> comparer);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (comparer As IEqualityComparer(Of TKey))

Parameters

comparer
IEqualityComparer<TKey>

키를 비교할 때 사용하는 같음 비교 구현입니다.The equality comparison implementation to use when comparing keys.

Exceptions

comparernull입니다.comparer is null.

See also

ConcurrentDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>)

지정된 ConcurrentDictionary<TKey,TValue>에서 복사된 요소가 포함되어 있고, 기본 동시성 수준과 기본 초기 용량을 가지며, 지정된 IEnumerable를 사용하는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable has the default concurrency level, has the default initial capacity, and uses the specified IEqualityComparer<T>.

public:
 ConcurrentDictionary(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ collection, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public ConcurrentDictionary (System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> collection, System.Collections.Generic.IEqualityComparer<TKey> comparer);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (collection As IEnumerable(Of KeyValuePair(Of TKey, TValue)), comparer As IEqualityComparer(Of TKey))

Parameters

collection
IEnumerable<KeyValuePair<TKey,TValue>>

요소가 새 IEnumerable<T>에 복사되는 ConcurrentDictionary<TKey,TValue>입니다.The IEnumerable<T> whose elements are copied to the new ConcurrentDictionary<TKey,TValue>.

comparer
IEqualityComparer<TKey>

키를 비교할 때 사용하는 IEqualityComparer<T> 구현입니다.The IEqualityComparer<T> implementation to use when comparing keys.

Exceptions

collection 또는 comparernull인 경우collection or comparer is null.

See also

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

지정된 동시성 수준과 용량을 갖고 있으며 키 형식에 대한 기본 비교자를 사용하는 비어 있는 ConcurrentDictionary<TKey,TValue> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the key type.

public:
 ConcurrentDictionary(int concurrencyLevel, int capacity);
public ConcurrentDictionary (int concurrencyLevel, int capacity);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : int * int -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (concurrencyLevel As Integer, capacity As Integer)

Parameters

concurrencyLevel
Int32

ConcurrentDictionary<TKey,TValue>를 동시에 업데이트할 예상 스레드 수입니다.The estimated number of threads that will update the ConcurrentDictionary<TKey,TValue> concurrently.

capacity
Int32

ConcurrentDictionary<TKey,TValue>에 포함될 수 있는 초기 요소 수입니다.The initial number of elements that the ConcurrentDictionary<TKey,TValue> can contain.

Exceptions

concurrencyLevel가 1보다 작습니다.concurrencyLevel is less than 1.

-또는--or- capacity가 0보다 작은 경우capacity is less than 0.

See also

ConcurrentDictionary<TKey,TValue>(Int32, IEnumerable<KeyValuePair<TKey,TValue>>, IEqualityComparer<TKey>)

지정한 ConcurrentDictionary<TKey,TValue>에서 복사된 요소를 포함하고 지정한 IEnumerable을 사용하는 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that contains elements copied from the specified IEnumerable, and uses the specified IEqualityComparer<T>.

public:
 ConcurrentDictionary(int concurrencyLevel, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ collection, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public ConcurrentDictionary (int concurrencyLevel, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> collection, System.Collections.Generic.IEqualityComparer<TKey> comparer);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : int * seq<System.Collections.Generic.KeyValuePair<'Key, 'Value>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (concurrencyLevel As Integer, collection As IEnumerable(Of KeyValuePair(Of TKey, TValue)), comparer As IEqualityComparer(Of TKey))

Parameters

concurrencyLevel
Int32

ConcurrentDictionary<TKey,TValue>를 동시에 업데이트할 예상 스레드 수입니다.The estimated number of threads that will update the ConcurrentDictionary<TKey,TValue> concurrently.

collection
IEnumerable<KeyValuePair<TKey,TValue>>

요소가 새 IEnumerable<T>에 복사되는 ConcurrentDictionary<TKey,TValue>입니다.The IEnumerable<T> whose elements are copied to the new ConcurrentDictionary<TKey,TValue>.

comparer
IEqualityComparer<TKey>

키를 비교할 때 사용하는 IEqualityComparer<T> 구현입니다.The IEqualityComparer<T> implementation to use when comparing keys.

Exceptions

collection 또는 comparernull인 경우collection or comparer is null.

concurrencyLevel가 1보다 작습니다.concurrencyLevel is less than 1.

collection에 중복 키가 하나 이상 포함된 경우collection contains one or more duplicate keys.

See also

ConcurrentDictionary<TKey,TValue>(Int32, Int32, IEqualityComparer<TKey>)

지정된 동시성 수준과 지정된 초기 용량을 갖고 있고 지정된 ConcurrentDictionary<TKey,TValue>를 사용하는 빈 IEqualityComparer<T> 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ConcurrentDictionary<TKey,TValue> class that is empty, has the specified concurrency level, has the specified initial capacity, and uses the specified IEqualityComparer<T>.

public:
 ConcurrentDictionary(int concurrencyLevel, int capacity, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public ConcurrentDictionary (int concurrencyLevel, int capacity, System.Collections.Generic.IEqualityComparer<TKey> comparer);
new System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value> : int * int * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Value>
Public Sub New (concurrencyLevel As Integer, capacity As Integer, comparer As IEqualityComparer(Of TKey))

Parameters

concurrencyLevel
Int32

ConcurrentDictionary<TKey,TValue>를 동시에 업데이트할 예상 스레드 수입니다.The estimated number of threads that will update the ConcurrentDictionary<TKey,TValue> concurrently.

capacity
Int32

ConcurrentDictionary<TKey,TValue>에 포함될 수 있는 초기 요소 수입니다.The initial number of elements that the ConcurrentDictionary<TKey,TValue> can contain.

comparer
IEqualityComparer<TKey>

키를 비교할 때 사용하는 IEqualityComparer<T> 구현입니다.The IEqualityComparer<T> implementation to use when comparing keys.

Exceptions

comparernull입니다.comparer is null.

concurrencyLevel 또는 capacity가 1 미만입니다.concurrencyLevel or capacity is less than 1.

See also

Applies to