ConcurrentDictionary<TKey, TValue> Constructor

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.

Namespace:  System.Collections.Concurrent
Assembly:  mscorlib (in mscorlib.dll)

public ConcurrentDictionary()

The default concurrency level is the default concurrency multiplier (DEFAULT_CONCURRENCY_MULTIPLIER) times the number of CPUs. The higher the default concurrency multiplier is, the more concurrent write operations can take place without interference and blocking. Higher multiplier values also cause operations that require all locks (for example, table resizing, ToArray and Count) to become more expensive. The default concurrency multiplier is 4. 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. The default capacity is 31.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft