Difference in .NET Dictionary HashTable with the ConcurrentDictionary

Common:

They are based on the data stored in the form of Key-Value set

the difference:                 

Dictionary: Advantages: support for generics, is type-safe. Namely: Dictionary <TKey, TValue>, the type of conversion can be reduced, reduce memory consumption

                      Disadvantages: thread-safe, data disorder may occur when multiple threads simultaneously access a Dictionary.

HashTable: Advantages: thread-safe

                      Cons: not a type-safe, hashTable <object, object>, type conversion required

 

ConcurrentDictionaey:

                     Pros: support for generics and thread-safe

Reference link: https: //blog.csdn.net/yinghuolsx/article/details/72952857

 

FIG operating efficiency comparison:

                 

 

 

Guess you like

Origin www.cnblogs.com/Echolh/p/11848402.html