ConcurrentDictionary<TKey,TValue> Konstruktory

Definice

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy.

Přetížení

ConcurrentDictionary<TKey,TValue>()

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a používá výchozí porovnávač pro typ klíče.

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

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje prvky zkopírované ze zadané IEnumerable<T>, má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a používá výchozí porovnávací nástroj pro typ klíče.

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

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má výchozí úroveň souběžnosti a kapacitu a použije zadanou IEqualityComparer<T>.

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

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje elementy zkopírované ze zadaného IEnumerable objektu má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a použije zadanou IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má zadanou úroveň souběžnosti a kapacitu a použije výchozí porovnávací nástroj pro typ klíče.

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

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje elementy zkopírované ze zadaného IEnumerableobjektu a použije zadaný IEqualityComparer<T>objekt .

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

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má zadanou úroveň souběžnosti, má zadanou počáteční kapacitu a použije zadanou IEqualityComparer<T>.

ConcurrentDictionary<TKey,TValue>()

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a používá výchozí porovnávač pro typ klíče.

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

Poznámky

Výchozí úroveň souběžnosti se rovná počtu procesorů. Čím vyšší je úroveň souběžnosti, tím více souběžných operací zápisu může probíhat bez rušení a blokování. Vyšší hodnoty úrovně souběžnosti také způsobují, že operace, které vyžadují všechny zámky (například změna velikosti ToArray tabulky a Count), se zdraží. Výchozí kapacita (DEFAULT_CAPACITY), která představuje počáteční počet kontejnerů, je kompromis mezi velikostí velmi malého slovníku a počtem velikostí při vytváření velkého slovníku. Kapacita by také neměla být dělitelná malými prvočísly. Výchozí kapacita je 31.

Viz také

Platí pro

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

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje prvky zkopírované ze zadané IEnumerable<T>, má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a používá výchozí porovnávací nástroj pro typ klíče.

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

Parametry

collection
IEnumerable<KeyValuePair<TKey,TValue>>

Čí IEnumerable<T> elementy jsou zkopírovány do nového ConcurrentDictionary<TKey,TValue>.

Výjimky

collection nebo některý z jeho klíčů je null.

collection obsahuje jeden nebo více duplicitních klíčů.

Viz také

Platí pro

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

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má výchozí úroveň souběžnosti a kapacitu a použije zadanou 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))

Parametry

comparer
IEqualityComparer<TKey>

Implementace porovnání rovnosti, která se má použít při porovnávání klíčů.

Výjimky

comparer je null.

Viz také

Platí pro

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

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje elementy zkopírované ze zadaného IEnumerable objektu má výchozí úroveň souběžnosti, má výchozí počáteční kapacitu a použije zadanou 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))

Parametry

collection
IEnumerable<KeyValuePair<TKey,TValue>>

Čí IEnumerable<T> elementy jsou zkopírovány do nového ConcurrentDictionary<TKey,TValue>.

comparer
IEqualityComparer<TKey>

Implementace IEqualityComparer<T> , která se má použít při porovnávání klíčů.

Výjimky

collection nebo comparer je null.

Viz také

Platí pro

ConcurrentDictionary<TKey,TValue>(Int32, Int32)

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má zadanou úroveň souběžnosti a kapacitu a použije výchozí porovnávací nástroj pro typ klíče.

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)

Parametry

concurrencyLevel
Int32

Odhadovaný počet vláken, která souběžně aktualizují ConcurrentDictionary<TKey,TValue> nebo pouze v rozhraní .NET 8+ -1, aby se vyznačovala výchozí úroveň souběžnosti.

capacity
Int32

Počáteční počet prvků, které může obsahovat ConcurrentDictionary<TKey,TValue> .

Výjimky

concurrencyLevel je menší než 1.

-nebo-

capacity je menší než 0.

Viz také

Platí pro

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

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která obsahuje elementy zkopírované ze zadaného IEnumerableobjektu a použije zadaný IEqualityComparer<T>objekt .

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

Parametry

concurrencyLevel
Int32

Odhadovaný počet vláken, která souběžně aktualizují ConcurrentDictionary<TKey,TValue> nebo pouze v rozhraní .NET 8+ -1, aby se vyznačovala výchozí úroveň souběžnosti.

collection
IEnumerable<KeyValuePair<TKey,TValue>>

Čí IEnumerable<T> elementy jsou zkopírovány do nového ConcurrentDictionary<TKey,TValue>.

comparer
IEqualityComparer<TKey>

Implementace IEqualityComparer<T> , která se má použít při porovnávání klíčů.

Výjimky

collection nebo comparer je null.

concurrencyLevel je menší než 1.

collection obsahuje jeden nebo více duplicitních klíčů.

Viz také

Platí pro

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

Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs
Zdroj:
ConcurrentDictionary.cs

Inicializuje novou instanci ConcurrentDictionary<TKey,TValue> třídy, která je prázdná, má zadanou úroveň souběžnosti, má zadanou počáteční kapacitu a použije zadanou 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))

Parametry

concurrencyLevel
Int32

Odhadovaný počet vláken, která souběžně aktualizují ConcurrentDictionary<TKey,TValue> nebo pouze v rozhraní .NET 8+ -1, aby se vyznačovala výchozí úroveň souběžnosti.

capacity
Int32

Počáteční počet prvků, které může obsahovat ConcurrentDictionary<TKey,TValue> .

comparer
IEqualityComparer<TKey>

Implementace IEqualityComparer<T> , která se má použít při porovnávání klíčů.

Výjimky

comparer je null.

concurrencyLevel nebo capacity je menší než 1.

Viz také

Platí pro