ConcurrentDictionary<TKey,TValue> Constructors

Definitie

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse.

Overloads

Name Description
ConcurrentDictionary<TKey,TValue>()

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de standaard-vergelijkingsfunctie voor het sleuteltype.

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

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerable<T>, heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de standaard comparer voor het sleuteltype.

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

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het standaard gelijktijdigheidsniveau en de standaardcapaciteit en gebruikt de opgegeven IEqualityComparer<T>.

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

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerable , heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de opgegeven IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het opgegeven gelijktijdigheidsniveau en de opgegeven capaciteit en gebruikt de standaard comparer voor het sleuteltype.

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

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerableen maakt gebruik van de opgegeven IEqualityComparer<T>.

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

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het opgegeven gelijktijdigheidsniveau, heeft de opgegeven initiële capaciteit en gebruikt de opgegeven IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>()

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de standaard-vergelijkingsfunctie voor het sleuteltype.

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

Opmerkingen

Het standaard gelijktijdigheidsniveau is gelijk aan het aantal CPU's. Hoe hoger het gelijktijdigheidsniveau is, hoe meer gelijktijdige schrijfbewerkingen kunnen plaatsvinden zonder interferentie en blokkering. Hogere gelijktijdigheidsniveauwaarden veroorzaken ook bewerkingen waarvoor alle vergrendelingen (bijvoorbeeld het wijzigen ToArray van de grootte van tabellen en Count) duurder moeten worden. De standaardcapaciteit (DEFAULT_CAPACITY), die het eerste aantal buckets aangeeft, is een afweging tussen de grootte van een zeer kleine woordenlijst en het aantal grootten bij het maken van een grote woordenlijst. De capaciteit mag ook niet deelbaar zijn met een klein priemnummer. De standaardcapaciteit is 31.

Zie ook

Van toepassing op

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

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerable<T>, heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de standaard comparer voor het sleuteltype.

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

De IEnumerable<T> elementen waarvan de elementen naar het nieuwe ConcurrentDictionary<TKey,TValue>worden gekopieerd.

Uitzonderingen

collection of een van de sleutels is null.

collection bevat een of meer dubbele sleutels.

Zie ook

Van toepassing op

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

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het standaard gelijktijdigheidsniveau en de standaardcapaciteit en gebruikt de opgegeven IEqualityComparer<T>.

public:
 ConcurrentDictionary(System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
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>

De implementatie van gelijkheidsvergelijking die moet worden gebruikt bij het vergelijken van sleutels.

Uitzonderingen

comparer is null.

Zie ook

Van toepassing op

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

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerable , heeft het standaard gelijktijdigheidsniveau, heeft de standaardinitiële capaciteit en gebruikt de opgegeven 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);
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>>

De IEnumerable<T> elementen waarvan de elementen naar het nieuwe ConcurrentDictionary<TKey,TValue>worden gekopieerd.

comparer
IEqualityComparer<TKey>

De IEqualityComparer<T> implementatie die moet worden gebruikt bij het vergelijken van sleutels.

Uitzonderingen

collection of comparer is null.

Zie ook

Van toepassing op

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het opgegeven gelijktijdigheidsniveau en de opgegeven capaciteit en gebruikt de standaard comparer voor het sleuteltype.

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

Het geschatte aantal threads dat de ConcurrentDictionary<TKey,TValue> gelijktijdig bijwerkt, of alleen in .NET 8+ -1 om het standaard gelijktijdigheidsniveau aan te geven.

capacity
Int32

Het eerste aantal elementen dat de ConcurrentDictionary<TKey,TValue> elementen kunnen bevatten.

Uitzonderingen

concurrencyLevel is kleiner dan 1.

– of –

capacity is kleiner dan 0.

Zie ook

Van toepassing op

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

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die elementen bevat die zijn gekopieerd uit de opgegeven IEnumerableen maakt gebruik van de opgegeven 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);
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

Het geschatte aantal threads dat de ConcurrentDictionary<TKey,TValue> gelijktijdig bijwerkt, of alleen in .NET 8+ -1 om het standaard gelijktijdigheidsniveau aan te geven.

collection
IEnumerable<KeyValuePair<TKey,TValue>>

De IEnumerable<T> elementen waarvan de elementen naar het nieuwe ConcurrentDictionary<TKey,TValue>worden gekopieerd.

comparer
IEqualityComparer<TKey>

De IEqualityComparer<T> implementatie die moet worden gebruikt bij het vergelijken van sleutels.

Uitzonderingen

collection of comparer is null.

concurrencyLevel is kleiner dan 1.

collection bevat een of meer dubbele sleutels.

Zie ook

Van toepassing op

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

Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs
Bron:
ConcurrentDictionary.cs

Initialiseert een nieuw exemplaar van de ConcurrentDictionary<TKey,TValue> klasse die leeg is, heeft het opgegeven gelijktijdigheidsniveau, heeft de opgegeven initiële capaciteit en gebruikt de opgegeven 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);
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

Het geschatte aantal threads dat de ConcurrentDictionary<TKey,TValue> gelijktijdig bijwerkt, of alleen in .NET 8+ -1 om het standaard gelijktijdigheidsniveau aan te geven.

capacity
Int32

Het eerste aantal elementen dat de ConcurrentDictionary<TKey,TValue> elementen kunnen bevatten.

comparer
IEqualityComparer<TKey>

De IEqualityComparer<T> implementatie die moet worden gebruikt bij het vergelijken van sleutels.

Uitzonderingen

comparer is null.

concurrencyLevel of capacity kleiner is dan 1.

Zie ook

Van toepassing op