Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ConcurrentDictionary(TKey, TValue) Constructor (Int32, Int32)

ConcurrentDictionary(Of TKey, TValue) Constructor (Int32, Int32)

.NET Framework 4.6 and 4.5

Initializes a new instance of the ConcurrentDictionary(Of TKey, TValue) class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the key type.

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

'Declaration
Public Sub New ( _
	concurrencyLevel As Integer, _
	capacity As Integer _
)

Parameters

concurrencyLevel
Type: System.Int32

The estimated number of threads that will update the ConcurrentDictionary(Of TKey, TValue) concurrently.

capacity
Type: System.Int32

The initial number of elements that the ConcurrentDictionary(Of TKey, TValue) can contain.

ExceptionCondition
ArgumentOutOfRangeException

concurrencyLevel is less than 1.

-or-

capacity is less than 0.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft