I have a dictionary that populates once in a static constructor and has remained unchanged since. I want multiple threads to be able to read values ββfrom this collection. Do I need a lock here?
According to Microsoft's documentation, the Dictionary class can support multiple readers at the same time, until the collection changes. Therefore, no locks are required.
. , . , - , , , , .
, . , , - , .
: , , . , , , .
- . , . , , .
, , , . , . , , , .
, , , , , , . , , .
, , , , .