Let's say I have ConcurrentDictionary<int, HashSet<int>> sampleCollection;
. Is it thread safe to perform operations on sampleCollection[1]
(which is a HashSet<int>
)?
In general, if we have a not thread-safe collection inside a thread-safe collection, is it thread-safe to operate the not thread-safe collection through the thread-safe outer one?