Re[5]: clr perf problem
От: Yoriсk  
Дата: 30.06.15 09:56
Оценка: +4
Здравствуйте, mapnik, Вы писали:

M>

M>A Dictionary can support multiple readers concurrently, as long as the collection is not modified. Even so, enumerating through a collection is intrinsically not a thread-safe procedure. In the rare case where an enumeration contends with write accesses, the collection must be locked during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.


Ну совсем как HashMap:

If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.


Но HashMap можно, а Dictionary — нет. Интересно.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.