Lock free hash table for C #

Does anyone know about implementing a hash table with locking in C #? Or can anyone confirm the fact that at least reading on a HashTable is thread safe?

Edit:

I can read the documentation, but this is unclear.

"It is thread safe for multi-threaded use when only one of the threads performs write (update) operations.

So the question is, if I have multiple threads, and all of them could be written to a hash table, I would use writerlock. However, the same streams are also read from the hash table. Do I need a reader on readings?

+3
source share
6 answers

, .

+5

:

Hashtable . , () , , Hashtable. Hashtable , , , , Hashtable.

. , , . , , .

+3

,.NET 4.0 ConcurrentDictionary System.Collections.Concurrent...

+2

- Lock, , , - , . ( ).

ReaderWriterLockSlim ( , ) Monitor ( ), .

+1
0

Source: https://habr.com/ru/post/1710275/


All Articles