ConcurrentDictionary(Of TKey, TValue)

The ConcurrentDictionary collection has the same purpose of its thread-unsafe counterpart, but it differs in how methods work. All methods for adding, retrieving, and removing items return a Boolean value indicating success or failure, and their names all start with Try. The following code shows an example:

image

The logic of the collection is then the same of Dictionary, so refer to this one for details.

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.